Skip to content
arktypeioPublic

About

TypeScript's smallest, fastest validator. One prompt away.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

7.9k stars

Watchers

13 watching

Forks

Repository files navigation

ArkType — TypeScript's smallest, fastest validator. One prompt away.

Docs  ·  Benchmarks  ·  Precompile  ·  Migrate from Zod  ·  Playground  ·  Discord

Quick start

npm install arktype

Write definitions in TypeScript's own syntax — inferred 1:1 and validated at runtime. Works with anything that takes Standard Schema (tRPC, Hono, React Hook Form, Drizzle, AI SDK, MCP SDK, and more).

import { type } from "arktype"

const User = type({
	name: "string > 0",
	email: "string.email",
	"age?": "number.integer >= 0"
})

// { name: string; email: string; age?: number }
type User = typeof User.infer

const out = User({ name: "Ada", email: "ada@", age: -1 })

if (out instanceof type.errors) {
	// email must be an email address
	// age must be non-negative
	console.error(out.summary)
} else {
	// out is a User
	console.log(out.name)
}

Migrate with one prompt

  1. Add the ArkType agent skill:

    npx skills add arktypeio/arktype
  2. Ask your coding agent:

    Migrate this project from Zod to ArkType.
    

See the migration guide for Zod, Valibot, TypeBox, Yup, Joi, Effect Schema, and JSON Schema.

Docs

CLI

arktype ships the ark binary (init, migrate, skill, and check / emit / declare via @ark/aot). Inside an installed project, run pnpm exec ark (or npx arktype everywhere — ark on npm is an unrelated package):

npx arktype init     # create ark.json and install the bundled skill
npx arktype migrate  # install the skill and print a migration prompt
npx arktype check    # run @ark/aot --check

Contributions

We accept and encourage pull requests from outside ArkType. Planned work is tracked in this GitHub project.

Depending on your level of familiarity with type systems and TS generics, some parts of the codebase may be hard to jump into. That said, there's plenty of opportunities for more straightforward contributions. We'd generally recommend starting with one of these issues labeled external-contributor-friendly.

If you're planning on submitting a non-trivial fix or a new feature, please create an issue first so everyone's on the same page. The last thing we want is for you to spend time on a submission we're unable to merge.

When you're ready, check out our guide to get started!

License

This project is licensed under the terms of the MIT license.

Code of Conduct

We will not tolerate any form of disrespect toward members of our community. Please refer to our Code of Conduct and reach out to david@arktype.io immediately if you've seen or experienced an interaction that may violate these standards.

Sponsorship

We've been working full-time on this project for multiple years and it means a lot to have the community behind us.

If the project has been useful to you and you are in a financial position to do so, please chip in via GitHub Sponsors.

Otherwise, consider sending me an email (david@arktype.io) or message me on Discord to let me know you're a fan of ArkType. Either would make my day!

ArkSponsors ⛵

get-convex

Sponsors 🥰

mewhhaha jahands Phalangers WilliamConnatser JameEnder
tylim88 tpetry braden-w

About

TypeScript's smallest, fastest validator. One prompt away.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

7.9k stars

Watchers

13 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages