Schema Libraries

This module works with any Standard Schema compatible library. Standard Schema is a shared interface that lets validation libraries work interchangeably.

Supported Libraries

LibraryBundle SizeStyle
Valibot~1KBFunctional, tree-shakeable
Zod~12KBMethod chaining
ArkType~25KBType-first, inference

All provide the same validation capabilities. Choose based on your preference.

Standard Schema Benefits

  • Swap libraries without changing module config
  • Type inference works the same across libraries
  • JSON Schema conversion handled automatically

Quick Comparison

import { object, string, number, optional } from 'valibot'

const schema = object({
  apiKey: string(),
  port: optional(number()),
})

Next Steps

  • Valibot - functional, minimal bundle
  • Zod - popular, rich ecosystem
  • ArkType - type-first validation