Standard Schema validators

You can use any Standard Schema validator with ArkEnv.

Any validator that implements the Standard Schema specification is supported. For example:

  • Zod - TypeScript-first schema validation
  • Valibot - Modular schema validation
  • ArkType (native) - TypeScript's 1:1 validator

ArkType works both as a validator and as a wrapper for other validators - all via Standard Schema. This means you can freely mix ArkType, Zod, Valibot, and any other Standard Schema validator in the same schema.

Tip

Want to avoid ArkType as a dependency altogether? Use arkenv/standard instead.

npm install arkenv arktype zod
pnpm add arkenv arktype zod
yarn add arkenv arktype zod
bun add arkenv arktype zod
env.ts
import  from 'arkenv';
import * as  from 'zod';

export const  = ({
  // ArkType DSL
  : "string.host",
  : "number.port",
  : "'development' | 'production' | 'test'",
  
  // Standard Schema (Zod)
  : .(),
  : .().(32),
});

Need help?

  1. Use arktype@>=2.1.28 - or switch to arkenv/standard to drop the ArkType dependency entirely
  2. Verify your validator library implements Standard Schema 1.0
  3. Join our Discord community for help

On this page