Prisma Zod Generator (v2.1.4) is a Prisma generator that emits Zod schemas from your Prisma schema, enabling end-to-end validation with Zod. It supports both ESM and CJS, requires Node >=20.19.0 and Zod >=3.25.0 <5. Key differentiators include multiple generation modes (minimal, full, custom), schema variants, decimal handling, DateTime support, naming patterns, selective generation, and a paid Pro tier with additional features like policy guardrails and Drift Guard. Active development with frequent releases.
npm install prisma-zod-generatorNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Install and configure Prisma Zod Generator, then validate Prisma model input using the generated Zod schema.
Use an absolute path or a path relative to the project root, e.g., output = "./src/generated/zod"
Migrate to v2 by removing 'Zod' prefix from import names. For example, 'ZodUser' becomes 'UserSchema'.
Update Node.js to v20.19.0 or later.
Rename mode from 'custom' to 'default' in Prisma schema generator config.
Ensure that 'compilerOptions.paths' or 'include' in tsconfig.json covers the output directory of the generated schemas.
Check that the 'output' path in schema.prisma is correct and run 'npx prisma generate'.
Ensure you are importing the correct named export (e.g., UserCreateInputSchema) and that the generator ran successfully.
Update to v1.5.0+ which includes Decimal handling, or configure a custom Zod type mapping.