[GH-ISSUE #3321] OpenAPI plugin support for Zod v4 (now stable) #9568

Closed
opened 2026-04-13 05:05:19 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @ubinatus on GitHub (Jul 9, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/3321

Originally assigned to: @Kinfe123 on GitHub.

Hello,

Zod v4 is now officially stable and brings major improvements over v3, including:
• Significant performance gains (faster parsing of strings, arrays, objects)
• Reduced core bundle size
• Improved TypeScript compiler performance
• Powerful new features like z.interface(), JSON Schema conversion, metadata support, and more

These changes are especially valuable for libraries like BetterAuth, where schema validation plays a critical role.

I noticed that the BetterAiuth openapi plugin already uses Zod v3 internally — which is great! Would it be possible to bring Zod v4 support as well? Aligning with the latest stable version would make it easier for downstream projects to adopt v4 without version mismatches.

Are there any plans for full Zod v4 compatibility in BetterAuth? If not yet, would you be open to a PR?

Thanks again for your excellent work on this library!

Originally created by @ubinatus on GitHub (Jul 9, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/3321 Originally assigned to: @Kinfe123 on GitHub. Hello, Zod v4 is now officially stable and brings major improvements over v3, including: • Significant performance gains (faster parsing of strings, arrays, objects) • Reduced core bundle size • Improved TypeScript compiler performance • Powerful new features like z.interface(), JSON Schema conversion, metadata support, and more These changes are especially valuable for libraries like BetterAuth, where schema validation plays a critical role. I noticed that the BetterAiuth openapi plugin already uses Zod v3 internally — which is great! Would it be possible to bring Zod v4 support as well? Aligning with the latest stable version would make it easier for downstream projects to adopt v4 without version mismatches. Are there any plans for full Zod v4 compatibility in BetterAuth? If not yet, would you be open to a PR? Thanks again for your excellent work on this library!
GiteaMirror added the locked label 2026-04-13 05:05:19 -05:00
Author
Owner

@Kinfe123 commented on GitHub (Jul 17, 2025):

We are also done with zod v4 migration to the main pacakge with treeshakable options. Thanks for the callout

<!-- gh-comment-id:3082337478 --> @Kinfe123 commented on GitHub (Jul 17, 2025): We are also done with zod v4 migration to the main pacakge with treeshakable options. Thanks for the callout
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#9568