Types & VarConfig Reference
Shorthand
"KEY": "type" validates the type only; the variable is required by default.
{
"env": [
{
"label": "web",
"path": "apps/web/.env.local",
"variables": {
"PORT": "port",
"DATABASE_URL": "url",
"API_KEY": "string"
}
}
]
}Shorthand-supported types: string, port, int, int+, float, bool, url, email, json, uuid. The pattern and enum types cannot use shorthand because they require additional fields (pattern or values).
VarConfig
For full control, use an object with a type and optional fields.
type
Required. One of: string, port, int, int+, float, bool, url, enum, email, json, uuid, pattern.
optional
Defaults to false. If true, a missing value passes validation — only present values are type-checked.
min / max
Type-specific range constraints:
- string — character length.
mindefaults to1,maxdefaults to255. - int / int+ / float — numeric value range.
pattern
A regex string used by the pattern type. Required when type is "pattern".
{
"VERSION": {
"type": "pattern",
"pattern": "^v?\\d+\\.\\d+\\.\\d+$"
}
}values
An array of allowed strings for the enum type. Required when type is "enum".
{
"NODE_ENV": {
"type": "enum",
"values": ["development", "production", "test"],
"optional": true
}
}schemes
An array of allowed URL schemes for the url type. Defaults to ["http", "https"].
{
"REDIS_URL": {
"type": "url",
"schemes": ["redis", "rediss"]
}
}trueValues / falseValues
Arrays of strings used to parse bool values. Defaults:
trueValues:["true", "1", "yes", "on"]falseValues:["false", "0", "no", "off"]
Unknown VarConfig keys cause an error (strict mode).
Types
| Type | Description |
|---|---|
string | Non-empty string. min/max = length (chars). |
port | Integer 1–65535. |
int | Any integer. |
int+ | Positive integer. min defaults to 1. |
float | Float. |
bool | Boolean. Uses trueValues/falseValues for parsing. |
url | URL. schemes restricts allowed schemes (default http/https). |
enum | One of values. Requires values array. |
email | Email address. |
json | Valid JSON. |
uuid | UUID. |
pattern | Regex match. Requires pattern field. |
Basic Example
{
"env": [
{
"label": "web",
"path": "apps/web/.env.local",
"variables": {
"PORT": "port",
"DATABASE_URL": "url",
"API_KEY": {
"type": "string",
"min": 1,
"max": 32
},
"DEBUG_MODE": "bool"
}
},
{
"label": "api",
"path": "apps/api/.env",
"required": "all",
"variables": {
"NODE_ENV": {
"type": "enum",
"values": ["development", "production", "test"],
"optional": true
},
"REDIS_URL": {
"type": "url",
"schemes": ["redis", "rediss"]
},
"RATE_LIMIT": {
"type": "int+",
"min": 1,
"max": 1000
}
}
}
]
}