tRPC is a framework for building end-to-end typesafe APIs in TypeScript without writing any API schema or code generation step. Created by Alex "KATT" Johansson in 2021, tRPC lets your frontend call backend functions directly with full autocompletion, type inference, and compile-time error checking. There is no REST endpoint definition, no GraphQL schema, no OpenAPI spec. You write a function on the server, and TypeScript knows exactly what it accepts and returns on the client. For full-stack TypeScript applications built with Next.js or similar frameworks, tRPC eliminates an entire category of bugs: the ones that happen when your frontend and backend disagree about data shapes.
Before tRPC, full-stack TypeScript developers had two options for API type safety: manually keep types in sync across client and server (error-prone and tedious), or adopt GraphQL with code generation tools like graphql-codegen (powerful but heavyweight). tRPC introduced a third path. By leveraging TypeScript's type inference across module boundaries, it made the API layer disappear. You define a router with procedures on the server, and the client gets a fully typed caller object that mirrors the router's shape. Change a return type on the server? The client gets a red squiggly line instantly. Add a required input field? TypeScript catches every call site that needs updating. This tight feedback loop fundamentally changed how fast developers can iterate on full-stack features. I use tRPC in projects where the frontend and backend share a TypeScript monorepo because the productivity gain is massive.
The most underappreciated aspect of tRPC is that it is not married to any specific transport layer. While most developers use it over HTTP with the standard adapter, tRPC can run over WebSockets for real-time subscriptions, over server-sent events, or even within the same process for server components. This flexibility means you can start with simple HTTP request/response patterns and layer in real-time features later without rewriting your API layer. The subscription support in particular is something teams often discover only after they have already adopted tRPC for queries and mutations, and it saves them from bolting on a separate WebSocket solution. It is one of those libraries where the more you use it, the more it gives you back.
Need a full-stack TypeScript app with end-to-end type safety? Let's talk architecture.