@trpc/server
End-to-end type-safe APIs — share TypeScript types between server and client without code generation.
You write a REST endpoint and manually duplicate its input/output types in the frontend. They drift apart. A field rename breaks the client silently. You add Zod schemas for validation, then OpenAPI for docs, then a codegen step to sync types. It's a lot of ceremony for what's just a function call.
tRPC removes the HTTP abstraction between frontend and backend. You define procedures (queries/mutations) on the server, and call them from the client as if they were local async functions. TypeScript infers all types across the boundary — no schemas, no codegen, no REST at all.
Use it when
Full-stack TypeScript monorepos, Next.js apps where frontend and backend share a codebase, projects where you want type safety without REST/GraphQL ceremony.
Skip it when
Public APIs consumed by third parties (use REST or GraphQL). Polyglot teams where some consumers aren't TypeScript. Microservices with many separate repos.
Ready to explore the full API?
See every class, function, and relationship in an interactive graph.