talira

End-to-end typesafe APIs made easy

open sourceMITfree

tRPC lets a TypeScript client call a TypeScript server's procedures with full type safety and no code generation. You define queries, mutations and subscriptions on a router, validating input with a library such as Zod, and the client imports only the router's type, so a server change shows up as a type error in the client before you save. Adapters run the server on Next.js, Express, Fastify, AWS Lambda, the Fetch API (Astro, Remix, SvelteKit, Cloudflare Workers) or plain Node, and requests can be batched. The client has no dependencies and a small bundle.

Problems it solves

  • call my TypeScript backend from the frontend with shared types
  • stop my API client drifting out of sync with my Node server
  • build a typed API for my Next.js app without writing a schema

Features

  • type-safe client from the server's router type, no code generation
  • queries, mutations and subscriptions
  • adapters for Next.js, Express, Fastify, Lambda and Fetch runtimes
  • request batching
  • input validation with libraries such as Zod

Alternatives

The same job

These do what tRPC does.

  1. gRPC A high performance, open source universal RPC framework
  2. Elysia Backend TypeScript framework with end-to-end type safety, built for Bun
  3. Hono Web framework built on Web Standards

Compare tRPC with the top 3