tRPC
trpc.io
1
Leaving SiteNav
External Link Disclaimer
You are about to visit trpc.io. This website is not operated by us. We are not responsible for its content or privacy practices.
About this website
tRPC is an open-source TypeScript RPC framework created by Alex slash Johannes Kllman in 2020, enabling end-to-end type-safe APIs without code generation, schema definitions, or build steps, by sharing TypeScript types directly between server and client code through direct function imports or over HTTP, eliminating the boilerplate and synchronization issues of traditional API approaches like REST, GraphQL, and gRPC while maintaining full type safety. The end-to-end type safety works by defining API procedures on the server as typed TypeScript functions, with the client automatically inferring the input and output types through TypeScript type inference over the router definition, meaning any change to the server procedure signature is immediately reflected in the client code with compile-time errors for mismatched types, without running any code generation or synchronization tool. The procedure definition supports queries for data retrieval, mutations for data modification, and subscriptions for real-time updates through WebSocket, with input validation through Zod schemas that provide both runtime validation and TypeScript type narrowing, ensuring that invalid requests are rejected with helpful error messages before reaching the handler. The middleware system enables authentication, logging, rate limiting, error handling, and request context injection through a composable chain pattern, with context typing automatically propagated through the middleware stack. The adapter support covers Express, Fastify, Next.js, Cloudflare Workers, Deno, AWS Lambda, and standalone HTTP, with React, Solid, Svelte, Vue, and vanilla clients. The subscription support uses WebSocket for real-time data. The error formatting provides structured error codes. Designed for TypeScript full-stack developers building type-safe APIs.
Statistics
1
Views
0
Clicks
0
Like
0
Dislike