
tRPC
A TypeScript library for building APIs whose types are shared between server and client, with no code generati
- Stars
- 40.8k
- Forks
- 1.7k
- Licence
- MIT
- Language
- TypeScript
- Last update
- 4 days ago
- Type
- Library
What it is
tRPC lets you build and call APIs in TypeScript where the client gets full type checking and autocompletion from the server's code, without writing separate schemas or generating code. The README says the client imports only type declarations from the server, not the server code itself. It includes adapters for React, Next.js, Express and Fastify, and says it is not tied to React.
- Build a full-stack Next.js app with typed API procedures, using the official starter example
- Add typed endpoints to an Express or Fastify server and call them from a React frontend
- Use request batching so simultaneous requests are combined into one
- Add subscriptions for live data, as listed in the features
Great for
- TypeScript teams building a web app where the frontend and backend are both written in TypeScript
- Developers adding typed APIs to an existing project (the README calls it easy to add to brownfield projects)
- Next.js or React developers who want typed calls between client and server
- Projects that want to avoid maintaining schemas or a code generation step
Not ideal for
- Teams whose clients are not TypeScript, since the main benefit is shared TypeScript types (the README does not describe other-language clients)
- Projects that need a language-neutral public API for third parties, where a standard like OpenAPI is usually expected (the README does not discuss this)
How to get it
- 1
Install with a package manager
You'll need: Node.js · A package manager such as npm, yarn, pnpm or bun
Create a full-stack Next.js starter (npm)
npx create-next-app --example https://github.com/trpc/trpc --example-path examples/next-prisma-starter trpc-prisma-starter - 2
Run it
- Pick an example from the examples folder or the trpc.io example apps list
- Run the create-next-app command for the Next.js and Prisma starter
- Open the generated project and follow the trpc.io documentation to run it
- 3
Get the most out of it
- Install the tRPC skills for AI coding agents with the command in the README (npx @tanstack/intent@latest install) for better code generation
- Read the examples folder to see working setups
- Browse the community adapters list on trpc.io for non-React or non-Express frameworks
- Use the documentation on tRPC.io for full setup details
Downloads
Strengths
- No code generation or build pipeline, according to the README
- The README states zero dependencies and a small client-side footprint
- Full static type safety for inputs, outputs and errors on the client
Trade-offs
- The README is focused on TypeScript; it does not describe use outside that ecosystem
- Relies on TypeScript type inference across the client and server, so both sides need to be in the same TypeScript project setup
- Documentation is hosted on an external site (trpc.io), and this README excerpt is truncated
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| trpc (this) | 40.8k | Library | intermediate | 4 days ago | TypeScript teams building a web app where the frontend and backend are both written in TypeScript |
| graphql | 17.6k | Framework | intermediate | 4 days ago | Developers building data-driven React apps who want a pre-assembled stack |
| blitz | 14.1k | Framework | intermediate | 12 months ago | Developers already comfortable with React and Next.js who want more built-in full-stack structure |
| fumadocs | 13.5k | Library | intermediate | 4 days ago | React developers who want to build a documentation site |
| cal.diy | 49.6k | App | advanced | 4 days ago | Individuals who want to self-host their own booking page |
| create-t3-app | 29.2k | CLI | intermediate | 11 months ago | Developers who already know some TypeScript and want a Next.js starting point |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.