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 zodpnpm add arkenv arktype zodyarn add arkenv arktype zodbun add arkenv arktype zodimport from 'arkenv';
import * as from 'zod';
export const = ({
// ArkType DSL
: "string.host",
: "number.port",
: "'development' | 'production' | 'test'",
// Standard Schema (Zod)
: .(),
: .().(32),
});Need help?
- Use
arktype@>=2.1.28- or switch toarkenv/standardto drop the ArkType dependency entirely - Verify your validator library implements Standard Schema 1.0
- Join our Discord community for help