Core concepts

Design, parse, and secure environment variables with ArkEnv.

Edit on GitHub

Missing or malformed environment variables fail as early as ArkEnv can see them: in next build, during Vite or Bun plugin runs, on server boot, and anywhere else you call arkenv().

These guides take you through designing a schema, parsing values, and keeping secrets off the client. They are meant to be read in order the first time. Skip ahead once you know which slice you need.

By the time you've read this section, you'll have a typed env object and a clear client/server split.

ArkEnv validates and types your environment. Loading .env files is still your runtime or framework's job. See Loading .env files.

From schema to env

Start here if you're writing a schema for the first time.

Next steps

Wire a runtime with the framework guides, pick an engine under validators, or skim the thinner Guides section for AI and migrations.