tRPC helps teams define server procedures and call them from clients with full TypeScript types for inputs, outputs, and errors—no schemas or codegen step.
Overview
tRPC is a TypeScript-first way to build and consume APIs where the client imports only type information from the server and still gets autocompletion and compile-time checks. Procedures can be queries, mutations, or subscriptions, composed into routers and validated with tools such as Zod.
The project emphasizes a small client footprint, no build-time code generation, and adapters for HTTP servers including Next.js, Express, Fastify, the Fetch API, AWS Lambda, and vanilla Node. Request batching can combine concurrent calls automatically.
Developers define procedures and export router types, stand up an HTTP server with an adapter, then create a client that shares those types. Materials describe it as framework-agnostic across JavaScript runtimes while shipping batteries-included React and Next.js integrations plus community adapters.
It is positioned for brownfield adoption: add typed endpoints incrementally and keep TypeScript inference aligned when server handlers change.
Key features
- Static types client to server
- No codegen build pipeline
- Queries, mutations, subscriptions
- HTTP adapters for many runtimes
- Optional request batching
- Zod-friendly input validation
- React and Next.js adapters
- Lightweight client library
Use cases
- Full-stack TypeScript products
- Typed internal admin APIs
- Next.js full-stack apps
- Replacing untyped REST wrappers
- Realtime subscription backends