πŸ›°οΈ tRPC

πŸ›°οΈ tRPC

Runtime Type checking

Given that the majority of API endpoints are accessible through the Internet, it is imperative to implement a zero trust security approach and diligently examine request data prior to proceeding with further processing.

Valibot is used for the lightest, fastest runtime type checking.

Valibot + Drizzle

Drizzle makes a library called drizzle-valibot (opens in a new tab) that generates Valibot schemas from TypeScript types.

This ensures there is no mismatch between the TypeScript types and the Valibot schemas.

This is also useful for validating data to be inserted into the database.