Using zod, you can define schemas you can use to validate data, from a simple string to a complex nested object. It's a zod variant with a functional, tree-shakable api that corresponds one-to-one with zod. For complete documentation on zod's schema api, refer to defining schemas.
Complete api reference for all zod schema types, methods, and validation features The zod/v4 package is the "flagship" library of the zod ecosystem. If you have uncommonly strict constraints around bundle size, consider zod mini.
In other cases, you may have a set of zod schemas you'd like to represent using multiple interlinked json schemas, perhaps to write to .json files and serve from a web server. In zod 3, when the results were unmergable, zod threw a zoderror with a special "invalid_intersection_types" issue. In zod 4, this will throw a regular error instead.
Zod mini implements the exact same functionality as zod, but using a functional, tree-shakable api. If you're coming from zod, this means you generally will use functions in place of methods. Jul 8, 2025if i naively published zod@4.0.0 to npm, the vast majority of the libraries in zod's ecosystem would need to publish a new major version to properly support zod 4, include some high.