Integrations

Standard Schema

ArkType is proud to support and co-author the new Standard Schema API with Valibot and Zod.

Standard Schema allows you and your dependencies to integrate library-agnostic validation logic. If you're building or maintaining a library with a peer dependency on ArkType and/or other validation libraries, we'd recommend consuming it through Standard Schema's API if possible so that your users can choose the solution that best suits their needs!

tRPC

ArkType can easily be used with tRPC via the assert prop:

t.procedure.input(
	({
		name: "string",
		"age?": "number"
	}).assert
)

react-hook-form

react-hook-form has builtin support for ArkType via @hookform/resolvers:

import { useForm } from "react-hook-form"
import { arktypeResolver } from "@hookform/resolvers/arktype"
import { type } from "arktype"

const  = type({
	firstName: "string",
	age: "number.integer > 0"
})

// in your component
const {
	,
	,
	formState: {  }
} = useForm({
	resolver: arktypeResolver()
})

hono

Hono has builtin support for ArkType via @hono/arktype-validator:

const  = ({
	name: "string",
	age: "number"
})

app.post("/author", arktypeValidator("json", ), c => {
	const  = c.req.valid("json")
	return c.json({
		success: true,
		message: `${.name} is ${.age}`
	})
})

hono-openapi also offers experimental support for OpenAPI docgen.

On this page