tRPC
A TypeScript framework that lets a frontend call backend procedures with full type safety by sharing the server’s types, with no code generation.
In more detail
The server defines a router of procedures and exports only its type, AppRouter. The client imports that type and TypeScript checks every call’s input and output. Because it depends on the TypeScript compiler, tRPC suits internal full-stack TypeScript monorepos rather than public APIs used from other languages.
Related terms
- RPC — A remote procedure call: calling a function in another program over a network as if it were a local function call.
- procedure — One callable server function in a tRPC router, declared as a query (read) or a mutation (write), with a validated input.
- tRPC router — The object that groups a server’s tRPC procedures by name; its type, usually exported as AppRouter, is all the client needs.
- type inference — The compiler working out a type from the code itself, so you do not have to write it out by hand.
Taught in
- Type-Safe Client Generation: Orval & Automated SDKs — Production Full-Stack Engineering
- Type-Safe RPC Architectures: tRPC & Procedures — Production Full-Stack Engineering