Sign in

ArkType

@arktype.io
587 followers 3 following 354 posts

TypeScript's 1:1 validator, optimized from editor to runtime ⛵ ⭐http://github.com/arktypeio/arktype 👋http://arktype.io/discord

PostsRepliesMedia
ArkType @arktype.io · 04/03/2026
@ark/json-schema — Bidirectional JSON Schema Parse JSON Schema into ArkType Types, and convert Types to JSON Schema. Huge thanks to @TizzySaurus for building this one. toJsonSchema() now supports configurable fallbacks, draft-07/2020-12 targets, and cyclic types.
220
ArkType @arktype.io · 04/03/2026
Standard Schema validators can now be embedded directly in ArkType definitions. Zod, Valibot, or anything else that implements the spec.
250
ArkType @arktype.io · 04/03/2026
Type-safe regex via arkregex Regex literals in your definitions now carry full type inference. x-prefix parses capture groups at runtime.
110
ArkType @arktype.io · 04/03/2026
type.fn Define runtime-validated functions using the same syntax you already know. Defaults, optionals, variadics- it all works.
110
ArkType @arktype.io · 04/03/2026
📢ArkType 2.2 is here. This is a big one, and it's long overdue. Validated functions, type-safe regex, bidirectional JSON Schema, and universal schema interop. Here's what's new 🧵
1332
ArkType @arktype.io · 22/12/2025
all you need to "learn" ArkType syntax: 1️⃣ start with a typescript keyword 2️⃣ .autocomplete to discover constraints 3️⃣ compose if needed with &, |, etc.
2201
ArkType @arktype.io · 18/12/2025
tools are just introspectable functions... what if you could define them like this?🤔
191
ArkType @arktype.io · 17/12/2025
wish TS had rust-style pattern matching? (it already does)🪄
2231
ArkType @arktype.io · 16/12/2025
🚨Standard JSON Schema v1 just dropped🚨 🟢libraries can now accept ArkType wherever they need JSON Schema 🟢100% type-safe with inference built-in 🟢day one support from AI SDK 🟢TanStack AI and MCP SDK support imminent
3333
ArkType @arktype.io · 11/12/2025
mission accomplished @mattpocock.com
0111
ArkType @arktype.io · 09/12/2025
"bUt StRiNgS aReN'T tYpE sAfE"
130
ArkType @arktype.io · 08/12/2025
95% of ArkType syntax is just TypeScript. The other 5% are extensions like this that are... ✅composable ✅consistent across data types ✅100% safe with helpful type-level error messages
1161
ArkType @arktype.io · 05/12/2025
once you go type("string") you never go z.back()
1162
ArkType @arktype.io · 02/12/2025
Difficulty of Parsing Regex with TypeScript Types ------------------------------------------------------------ group associativity ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ everything else ▒▒
260
ArkType @arktype.io · 01/12/2025
In the next version of ArkType, any Standard Schema is a valid definition. Zod migration is about to get a whole lot easier🚀
3385
ArkType @arktype.io · 26/11/2025
fastest, cleanest tuple validation around
281
ArkType @arktype.io · 24/11/2025
RIP z.shark() long live sharktype
0201
ArkType @arktype.io · 20/11/2025
friends don't let friends have unsafe regex
1151
ArkType @arktype.io · 19/11/2025
coming in ArkType 2.2... e(x)ec mode for regex literals🧑‍🍳
1110
ArkType @arktype.io · 18/11/2025
📈arkregex just hit 100k installs/week📈 if you're still using untyped RegExp() you may as well just write raw .js
1211
ArkType @arktype.io · 13/11/2025
string validation has never been this easy arktype🤝arkregex
1151
ArkType @arktype.io · 12/11/2025
problem: your RegExp is beyond human comprehension solution: pnpm i arkregex
162
ArkType @arktype.io · 10/11/2025
I'll take "meticulously typed regex features you probably didn't know existed" for $500
1322
ArkType @arktype.io · 07/11/2025
in the latest version of arktype: regex properties and index signatures from arkregex🔒
1101
ArkType @arktype.io · 06/11/2025
imagine using untyped regex in 2025
1151
ArkType @arktype.io · 05/11/2025
arkregex is meant to be a zero-effort, drop-in replacement for new RegExp(). in the vast majority of cases, it makes your life easier. for the rest, just don't use it👍
181
ArkType @arktype.io · 05/11/2025
option 2: just use new RegExp() for those cases if you don't care about those types
140
ArkType @arktype.io · 05/11/2025
option 1: use regex.as to declare a simplified version of your pattern and capture groups
150
ArkType @arktype.io · 05/11/2025
we've been surprised by some of the real-world expressions it can handle, but you'll still hit the limits of typescript eventually, so what then?
150
ArkType @arktype.io · 05/11/2025
arkregex is ridiculously optimized. even expressions like this are inferred instantly. but what about the most extreme cases?🧵
1282
ArkType @arktype.io · 03/11/2025
new RegExp(): ❌types 😴tired arkregex: ✅types 🫨wired
2282
ArkType @arktype.io · 30/10/2025
tHaNkS fOR 7k⭐
1180
ArkType @arktype.io · 28/10/2025
📢Introducing ArkRegex📢 a drop in replacement for new RegExp() with types ⬇️
317527
ArkType @arktype.io · 09/10/2025
new to typescript? here's a handy little type for parsing regular expressions:
161
ArkType @arktype.io · 08/10/2025
soon
2101
ArkType @arktype.io · 07/10/2025
🙅convoluted regex 👍simple types
091
ArkType @arktype.io · 06/10/2025
the days of untyped regex are numbered
0190
ArkType @arktype.io · 24/09/2025
Ever get mixed up about unions and intersections? ArkType has your back🫡
172
ArkType @arktype.io · 23/09/2025
"any sufficiently advanced typescript types are indistinguishable from magic" - Arthur C. Clark, 1962
1828
ArkType @arktype.io · 22/09/2025
Like type-safe environment variables? Now there's a better way to get them with arkenv⛵❤️
1181
ArkType @arktype.io · 20/09/2025
our two-step process for fast typescript types: 1️⃣ build a type-level benchmarking library 2️⃣ spend the prime of your life on cache optimizations
1275
ArkType @arktype.io · 17/09/2025
attest can snapshot types, type errors and autocomplete results. all from your existing unit tests📚🔗⬇️
271
ArkType @arktype.io · 16/09/2025
⚠️trade offer⚠️ i receive: JSON Schema you receive: lightning-fast validation and clear errors
2161
ArkType @arktype.io · 11/09/2025
How to use ArkType: 1️⃣ write typescript 2️⃣ use it in editor 3️⃣ use it at runtime
231
ArkType @arktype.io · 10/09/2025
turns out having type syntax at runtime is pretty nice
160
ArkType @arktype.io · 09/09/2025
1️⃣ start with a typescript keyword 2️⃣ .autocomplete the rest
170
ArkType @arktype.io · 08/09/2025
zod4 is 5x faster than zod3 for object validation. arktype is 20x faster than zod4.
1101
ArkType @arktype.io · 06/09/2025
typescript is crazy
060
ArkType @arktype.io · 05/09/2025
you deserve better type errors
061
ArkType @arktype.io · 04/09/2025
challenge: create an unsatisfiable arktype schema difficulty: mathematically impossible
150