{"schemaVersion":1,"id":"zod","name":"Zod","locale":"en","canonicalUrl":"https://base.akulich.dev/en/library/zod/","officialUrl":"https://github.com/colinhacks/zod","isCatalog":false,"description":"A TypeScript schema and data validation library: it validates API inputs, forms, and configurations while inferring static types from schemas.","tasks":["Validate data at TypeScript application boundaries","Connect parsing and diagnostic errors to an application handler"],"categoryIds":["backend","frontend"],"subcategoryIds":["backend.api","frontend.forms"],"tags":["Zod","API","Development"],"aliases":["colinhacks/zod","zod","typescript-schema-validation","static-type-inference"],"platforms":[],"stack":[],"compatibility":null,"pricing":"free","freeUsage":"Code and local use under MIT.","paidUsage":"Compute, your own hosting, and external services are paid for separately if selected.","license":"MIT: code; dependencies have separate licenses.","selectionGuide":{"purpose":"Validate actual input data against a schema and obtain TypeScript types from it.","chooseWhen":["JSON needs validation at an API or configuration boundary.","A shared form and data-processing contract is needed."],"considerInstead":["An ordinary function or built-in form rule may suffice for checking one field."],"requirements":["A JavaScript/TypeScript project, a schema, and error-handling rules."],"limitations":["A static TypeScript type does not replace running validation.","Asynchronous rules require the corresponding asynchronous method."],"faq":[{"question":"Which should I choose: parse or safeParse?","answer":"parse throws a validation error; safeParse returns a result with a success flag. Choose the error model convenient for the handler."}],"related":[{"id":"react-hook-form","reason":"Complement: React form state and error display; Zod defines the schema."},{"id":"vitest","reason":"Complement: checks schemas with valid and invalid examples."}],"sources":["https://zod.dev/basics"]},"selectionCheckedAt":"2026-10-07","applicationGuide":{"goal":"Validate profile JSON before saving.","inputs":["The name and contact field contract.","Valid JSON and violation examples."],"steps":["Define the object schema.","Call safeParse on the received JSON and handle both branches.","Check a missing field and an incorrect type separately."],"checks":["Invalid input does not reach storage.","The message identifies the problematic field."]},"sources":["https://github.com/colinhacks/zod","https://raw.githubusercontent.com/colinhacks/zod/HEAD/README.md","https://raw.githubusercontent.com/colinhacks/zod/HEAD/LICENSE","https://www.open-source-tools.com/","https://zod.dev/basics"],"checkedAt":"2026-10-06","reviewScope":"Purpose, the current repository license, and the boundaries between code, services, and models were reviewed. The product was not run or security-audited.","relatedIds":["valibot","react-hook-form","tanstack-form","vitest"],"dataVersion":"cbbe7123b47a5ae80983","type":"Backend / API library","kind":"library","pricingNote":"Code and local use under MIT. Compute, your own hosting, and external services are paid for separately if selected.","notes":null,"labeledSources":[{"url":"https://github.com/colinhacks/zod","label":"Official source"},{"url":"https://raw.githubusercontent.com/colinhacks/zod/HEAD/README.md","label":"Official source"},{"url":"https://raw.githubusercontent.com/colinhacks/zod/HEAD/LICENSE","label":"License"},{"url":"https://www.open-source-tools.com/","label":"Catalog / discovery source"},{"url":"https://zod.dev/basics","label":"Product documentation"}],"licenseGuides":[{"id":"mit","title":"MIT — permissive license","scope":null,"summary":"You can use, modify, distribute, and sell the code, including in a closed-source commercial product. When sharing copies or substantial portions of the code, retain the license text and copyright notice. You do not need to open-source your entire project; the author provides no warranties.","url":"https://opensource.org/license/mit"}],"entryIds":[],"composition":null}