API reference
Overview
Every export of @vlandoss/env, organized by the entrypoint you import it from.
The package is split into five entrypoints. Each page here documents one of them — signature, options, return type, and a minimal usage snippet. For "when to reach for this" prose, follow the link back to the guide that uses it.
Entrypoints
| Page | Import | Lives in |
|---|---|---|
| Core | @vlandoss/env | Any runtime — schema, defineEnv, envName |
| Filesystem | @vlandoss/env/fs | Node / Bun / Deno — loadConfig |
| Vite | @vlandoss/env/vite | Vite config — envConfig() plugin |
| React | @vlandoss/env/react | SSR / SSG — <EnvScript /> |
| Zod primitives | @vlandoss/env/zod | Any — opinionated single-purpose schemas |
Conventions used in this section
- Tables list options in declaration order.
- Sync vs. async behavior is marked explicitly on overloaded functions.
- Each export page ends with a "See also" linking to the relevant guide and concept page.
Custom modes (staging, qa)
Surface non-default Vite modes to browser code. Why the envConfig() plugin is required even if you load config via dynamic import.
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.