tRPC

trpc.io

End-to-end typesafe APIs for TypeScript — no codegen, shared types client to server.

Overview

tRPC is a framework for building fully typesafe APIs in TypeScript without requiring schemas or code generation. It leverages TypeScript's type inference to automatically provide end-to-end type safety between client and server, catching API contract mismatches at build time rather than runtime.

The framework combines concepts from REST and GraphQL, offering a lightweight alternative to traditional API layers. With zero runtime dependencies and a tiny client-side footprint, tRPC enables rapid full-stack development with automatic autocompletion and type checking across the client-server boundary. It works standalone or can be mounted as an endpoint on existing REST APIs through its extensive ecosystem of adapters for popular frameworks like Next.js, Express, Fastify, and many others.

Key features

  • End-to-end type safety without code generation
  • Automatic client autocompletion and intellisense
  • Zero runtime dependencies
  • Framework agnostic with adapters for Next.js, Express, Fastify, and more
  • Support for queries, mutations, and subscriptions
  • Request batching
  • Input validation with Zod, Yup, or Valibot
  • Real-time subscriptions support
Pros
  • No build or compile steps required
  • Tiny bundle size and lightweight
  • Snappy developer experience with instant feedback
  • Works with existing projects and brownfield codebases
  • Extensive adapter ecosystem for popular frameworks
  • Type inference catches errors before runtime
Cons
  • Requires TypeScript (>=5.7.2) and strict mode recommended
  • Tightly couples client and server code in monorepo structure
  • Not suitable for public APIs without OpenAPI adapters
  • Learning curve for developers unfamiliar with TypeScript inference patterns
Use this if
You're building a full-stack TypeScript application and want automatic type safety across client-server boundaries without code generation or traditional API layers.
Skip this if
You need to build public REST APIs, are not using TypeScript, or require strict separation between frontend and backend repositories.

Best for

Full-stack TypeScript projectsRapid API development with type safetyMonorepo applicationsTeams prioritizing developer experienceProjects avoiding traditional REST/GraphQL overhead

Alternatives

GraphQLREST APIstRPC alternatives like Remix loadersOpenAPI/Swagger for public APIs

Compare tRPC alternatives

More Framework

Compare all
View Jasmine
Jasmine

Testing framework designed specifically for JavaScript code.

View Next.js
Next.js

React framework for production with SSR, static generation, API routes, and App Router.

View eve
eve

Framework for building autonomous AI agents, designed by Vercel as a filesystem-first approach to agent development.

View Ivy Framework
Ivy Framework

Modern C# framework designed for building reactive full-stack web applications entirely in pure C#.