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 init
pnpm dlx @arkenv/cli@latest init
yarn dlx @arkenv/cli@latest init
bunx @arkenv/cli@latest init

If 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:

.env
  LOG_LEVEL=info
  API_KEY=secret
  ALLOWED_ORIGINS=http://localhost:3000,https://example.com

We recommend not committing the .env file to version control.

Now you can import and use your validated and typed environment variables!

database.ts
  import {  } from './env';

  const dbConfig = {
const dbConfig: {
    host: string;
    port: number;
}
: ., : ., };

Next steps