Quickstart
Let's get you started with a few simple steps.
The easiest way to get started is with the ArkEnv CLI. It interactively configures your project, installs dependencies, and creates a ready-to-use schema.
npx @arkenv/cli@latest initpnpm dlx @arkenv/cli@latest inityarn dlx @arkenv/cli@latest initbunx @arkenv/cli@latest initIf you prefer to install ArkEnv yourself without the interactive CLI, check out the manual installation steps:
Usage
Once your project is configured and your env.ts schema is created, you can start using your environment variables!
Just define some environment variables in a .env file in your project root:
LOG_LEVEL=info
API_KEY=secret
ALLOWED_ORIGINS=http://localhost:3000,https://example.comWe recommend not committing the
.envfile to version control.
Now you can import and use your validated and typed environment variables!
import { } from './env';
const dbConfig = { : .,
: .,
};Next steps
Standard Schema Validators
Use Zod, Valibot, or any Standard Schema validator with ArkEnv
IDE Integrations
Get syntax highlighting, ErrorLens, and more for VS Code
Examples
Dive into ArkEnv with our collection of examples
How to load environment variables
Learn environment variables management in different environments and deployment scenarios