What is tRPC?
Turkish: tRPC
tRPC carries server procedure types to TypeScript clients end to end without requiring a separate API schema or code generation step.
What is tRPC?
tRPC is an RPC framework for full-stack TypeScript applications where the API contract is inferred from TypeScript types. Input and output types from server procedures are automatically known by the client code.
How Does It Work?
On the server, tRPC defines routers and procedures. A procedure can be a query or mutation, and input validation is often handled with a schema library such as Zod. The client imports the router type and gets autocomplete plus type errors during development.
This gives type safety without maintaining a separate OpenAPI file, GraphQL schema, or code generation step. The trade-off is that client and server are expected to live in the same TypeScript ecosystem.
When Is It a Good Fit?
tRPC works well for fast product development in Next.js or similar TypeScript monorepo applications. For APIs exposed to external developers, consumed by multiple languages, or requiring long-term version contracts, REST API or GraphQL may be a better fit.