End-to-end typesafe APIs made easy
The client above is not importing any code from the server, only it's type declarations.
Import type only imports declarations to be used for type annotations and declarations. It always gets fully erased, so thereβs no remnant of it at runtime.
tRPC allows you to easily build & consume fully typesafe APIs, without schemas or code generation.
- π§ββοΈ Full static typesafety & autocompletion on the client - on inputs, outputs, & errors.
- π Snappy DX. No code generation, run-time bloat, or build pipeline.
- π Light. tRPC has zero deps and a tiny client-side footprint.
- π» Easy to add to your existing brownfield project.
- π Batteries included. React-library + Next.js/Express adapters. (But tRPC is not tied to React - reach out if you want to make a Svelte/Vue/... lib)
- π₯ Simple to use APIs for queries, mutations, & subscriptions support.
- β‘οΈ Request batching - requests made at the same time can be automatically combined into one
... and:
- π Quite a few examples in the ./examples-folder
- β It's well-tested & running in production.
Still reading? Follow @alexdotjs on Twitter if you have any questions or want to keep up to date what's coming next.
π See full documentation documentation on tRPC.io. π
Quick start with a full-stack Next.js example:
npx create-next-app --example https://github.com/trpc/trpc --example-path examples/next-prisma-starter trpc-prisma-starter
Alex / KATT |
π Hi, I'm Alex and I am the main maintainer if tRPC, don't hesitate to contact me on Twitter or email if you are curious about tRPC in any way.
If you like working with tRPC, consider giving a token a apprecation by GitHub Sponsors or get in touch if you want your company's logo featured in the tRPC repository or on the website.
Anthony Short |
Hampus Kraft |
Daniel Yogel |
Sam Holmes |
Jan Zimmek |
tRPC is developed by KATT, originally based on a proof-of-concept by colinhacks.