API reference

Core

Exports from the @vlandoss/env entrypoint — the runtime-agnostic core where schemas are declared, env is resolved, and the current environment name is detected.

The @vlandoss/env entrypoint is the only one you always import — it contains the runtime-agnostic core. Adapter entrypoints (/node, /vite, /react, /zod) build on top of it.

Exports

ExportKindSummary
schemaFunctionDeclare the contract — branches and Standard Schema leaves.
defineEnvFunctionMerge config + environment variables, validate, and return a typed env object.
envNameFunctionDetect the current environment name across runtimes — development, production, …
readEnvFunctionRead raw values from the active source (process.env on the server, window.__env in the browser). Returns {} on runtimes without process (Workers) — pass runtimeEnv to defineEnv instead.
ConfigTypeThe input shape of per-environment config files for a given schema.
EnvTypeThe output shape of the resolved env object for a given schema.

Full signatures and option tables are coming soon. Until then, see Concepts → Overview for the mental model and Quickstart for a runnable example.

See also

On this page