Ecosystem

ArkEnv

ArkEnv brings the power of ArkType to your environment variables.

Define an ArkType schema, pull values from your environment or config source, validate them, apply type conversions and transformations, and end up with a fully typesafe, ready-to-use env object.

Inspired by tools like T3 Env but tailored specifically for ArkType, ArkEnv also adds keywords like string.host and number.port for env-specific use cases.

import arkenv from "arkenv"

const  = arkenv({
	HOST: "string.host",
	PORT: "number.port",
	NODE_ENV: "'development' | 'production' | 'test' = 'development'"
})

// Automatically validate and parse process.env
// TypeScript knows the ✨exact✨ types!
console.log(.HOST) // (property) HOST: string
console.log(.PORT) // (property) PORT: number
console.log(.NODE_ENV) // (property) NODE_ENV: "development" | "production" | "test"

DRZL

DRZL is zero-friction codegen for Drizzle ORM, tailored for ArkType developers. It analyzes your Drizzle schemas and generates ArkType validation schemas, services, and routers—eliminating boilerplate and ensuring seamless type safety between your database and application layers.

// drzl.config.ts
import { defineConfig } from "@drzl/cli/config"

export default defineConfig({
	schema: "src/db/schemas/index.ts",
	outDir: "src/api",
	generators: [
		// 1) ArkType validators
		{ kind: "arktype", path: "src/validators/arktype", schemaSuffix: "Schema" },

		// 2) Routers (oRPC adapter), reusing ArkType schemas
		{
			kind: "orpc",
			template: "@drzl/template-orpc-service",
			includeRelations: true,
			outputHeader: { enabled: true },
			validation: {
				useShared: true,
				library: "arktype",
				importPath: "src/validators/arktype",
				schemaSuffix: "Schema"
			}
		},
		// 3) Typed services (Drizzle-aware or stub)
		{
			kind: "service",
			path: "src/services",
			dataAccess: "drizzle", // or 'stub'
			dbImportPath: "src/db/connection",
			schemaImportPath: "src/db/schemas"
		}
	]
})

For more details, see the Getting Started guide.

shorn

shorn turns an ArkType type into compact binary serialization. Field names and type tags stay out of the payload because the type already provides them, so there is no schema language to learn and nothing to generate.

ArkType 2.1.28 and newer implements both Standard Schema and Standard JSON Schema, so a type can be passed straight to encode. Validation runs on encode and again on decode.

import { type } from "arktype"
import { decode, encode } from "@chichurita/shorn"

const  = type({
	name: "string",
	age: "number.integer >= 0",
	sex: "'M' | 'F' | 'X'"
})

const  = encode(, { name: "Grace", age: 45, sex: "F" })
.length // 8, where the same record is 35 bytes of minified JSON

decode(, ) // typed and validated

ArkType objects are open by default, so shorn rejects undeclared properties during encoding rather than dropping data. Use "+": "delete" to strip expected extras. See the ArkType guide for the details.

On this page