Zod · Type Alias
TypeOf
Zod lets you define schemas, validate unknown data, and derive TypeScript types from those schemas. Use parse when errors should throw, or safeParse when they should be returned.
Last updated
Syntax
const Schema = z.object({ field: z.string() });
Schema.parse(input);
Schema.safeParse(input);
type Output = z.infer<typeof Schema>;In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
parsesafeParseparseAsyncsafeParseAsyncz.inferz.inputz.outputz.object