ian
ian2y ago

Input Validation (with Zod)?

What's the recommended way to do input validation?
1 Reply
ian
ianOP2y ago
I wrote a post on wrappers to use Zod to do input validation, that give you the right types on the client and validated input on the server using a withZod wrapper inside your convex functions: https://stack.convex.dev/wrappers-as-middleware-zod-validation
Zod Validation: Wrappers as “Middleware”
Function validation is important for a production app because you can’t always control which clients are talking to your server. See how to use zod to...