Skip to main content

tRPC

End-to-end typesafe APIs made easy

Star

Server/client example
The client above is not importing any code from the server, only its type declarations. import type only imports declarations to be used annotations and declarations. It always gets fully erased, so there’s no remnant of it at runtime.

Get Started

🧙‍♂️  Automatic typesafety

Automatic typesafety & autocompletion inferred from your API-paths, their input data, & outputs.

🍃  Light & Snappy DX

No code generation, run-time bloat, or build pipeline. Zero dependencies & a tiny client-side footprint.

🐻  Add to existing brownfield project

Easy to add to your existing brownfield project with adapters for Connect/Express/Next.js.

  1. @trpc/client depends on some babel runtime helpers + that a fetch() polyfill/ponyfill is used if the browser doesn't support it. @trpc/react is built on top of react-query.