Get Zod Schema from Better-Auth to use in form libraries

Is there a way to generate Zod schema or get Zod schema for better auth endpoints? I am using Hono.js. I am currently defining Zod schema on client, but obviously this causes the problem of schema drift. Lots of form libraries like React Hook Form or SvelteKit Superforms takes a Zod schema.
2 Replies
KiNFiSH
KiNFiSH4w ago
Can you please specify the use case just to clearly understand it
Acro
AcroOP4w ago
Yeah like I was saying, the server is normally the source of truth. So if we could retrieve or generate Zod Schema from better-auth. This is to prevent manually defining zod schema in client side code which can drift from server.

Did you find this page helpful?