API Reference
Types for createEnv and resolved env configuration.
CreateEnvOptions
| Option | Type | Description |
|---|---|---|
server? | | Server-only variables; validated only when |
client? | | Variables safe on the client; always validated unless |
clientPrefix? | | Prefix every |
emptyStringAsUndefined? | | Treat |
isServer? | | Override server detection. Default: no |
onInvalidAccess? | | Called when a non-client key is read on the client. May throw a custom error; otherwise the default is thrown. |
onValidationError? | | Called when schema validation fails. May throw a custom error; otherwise the default is thrown. |
runtimeEnv? | | Loose record to read values from (e.g. |
runtimeEnvStrict? | | Explicit per-key mapping; mutually exclusive with |
ResolvedCreateEnvOptions
| Option | Type | Description |
|---|---|---|
client | | Client-safe schema shape. |
clientPrefix | | Prefix every |
emptyStringAsUndefined | | Treat `false`. |
isServer | | Whether we're in a server context. `typeof window === "undefined"`. |
onInvalidAccess | | Called when a non-client key is read on the client. May throw a custom error; otherwise the default is thrown. `undefined`. |
onValidationError | | Called when schema validation fails. May throw a custom error; otherwise the default is thrown. `undefined`. |
runtime | | Record to read values from (e.g. |
server | | Server-only schema shape. |
skipValidation | | Skip schema validation and return picked runtime values only. `false`. |