Validators

Choose between @arkenv/core and @arkenv/standard, then wire ArkType, Zod, or Valibot.

Edit on GitHub

ArkEnv ships two engines. Both call arkenv(), share fail-fast errors, the coercion pipeline, and framework plugins. Shared options (env, coerce, safe, …) apply to both. toJsonSchema is on @arkenv/standard only; ArkType already exposes JSON Schema. The engines also differ in schema style and peer dependencies.

@arkenv/core@arkenv/standard
Schema styleArkType DSL strings + type()Per-key Standard Schema validators
Typical librariesArkTypeZod, Valibot, VineJS, Zod Mini, …
Runtime dependenciesNoneNone
Peer arktypeRequiredNone
Env keywords (string.host, number.port)YesUse the validator's own APIs
CoercionBuilt-inBuilt-in when fields expose Standard JSON Schema v1, via /valibot or /zod-mini, or via toJsonSchema
Framework plugins@arkenv/nextjs, …Same packages via /standard subpaths

Pick the engine that matches the schema library you write, then follow the cookbook below.

Side by side

The same keys, two declaration styles. Zod 4.2+ does not need z.coerce; ArkEnv coerces first.

./env.ts
import  from "@arkenv/core";

export const  = ({
  : "string",
  : "number.port = 3000",
  : "'development' | 'production' | 'test' = 'development'",
});
./env.ts
import  from "@arkenv/standard";
import * as  from "zod";

export const  = ({
  : .(),
  : .().(0).(65535).(3000),
  : 
    .(["development", "production", "test"])
    .("development"),
});

Install either stack the same way you would any env schema: one validation package, then framework plugins if you need them.

ArkType engine:

npm install @arkenv/core arktype
pnpm add @arkenv/core arktype
yarn add @arkenv/core arktype
bun install @arkenv/core arktype

Standard Schema engine:

npm install @arkenv/standard
pnpm add @arkenv/standard
yarn add @arkenv/standard
bun install @arkenv/standard

When each fits

SituationEngine
You want ArkType's DSL and ArkEnv keywords@arkenv/core
The app already uses Zod or Valibot for other schemas@arkenv/standard
You must stay ArkType-free@arkenv/standard
You are scaffolding a new TypeScript app and like ArkType@arkenv/core

ArkType itself implements Standard Schema. If you already depend on ArkType, stay on @arkenv/core rather than wrapping ArkType types through @arkenv/standard.

Packaging

Engines are separate packages so peer dependencies stay honest. Framework plugins stay single packages with /standard subpaths (@arkenv/nextjs/standard, @arkenv/vite-plugin/standard, and so on) instead of a second npm package per host.

JSON Schema and coercion

Standard Schema and Standard JSON Schema are orthogonal specs: one is about validation, the other about converting a type to JSON Schema. A value can implement one, both, or neither.

ArkEnv's pre-coercion step for @arkenv/standard prefers Standard JSON Schema v1 on the value (~standard.jsonSchema.input / .output). When a library keeps conversion outside the schema, use a first-class subpath or the optional toJsonSchema escape hatch.

LibraryHow ArkEnv gets JSON Schema
Zod (v4.2+)On the value (Standard JSON Schema v1)
VineJS (v4.3+)On the value (Standard JSON Schema v1)
Valibot (v1.2+ with @valibot/to-json-schema)@arkenv/standard/valibot (see Valibot)
Zod Mini@arkenv/standard/zod-mini (mixing)
Other Standard JSON Schema v1 validatorsOn the value

See Coercion and parsing.

A one-file Env.assert(process.env) works for a hello-world Node script. ArkEnv adds env-specific errors, automatic coercion, a CLI, and framework plugins that keep server secrets out of the client graph. See Why ArkEnv? for DIY, Varlock, T3 Env, znv, Envalid, and related tools.

Cookbooks