tRPC

tRPC

trpc/trpc: ๐Ÿง™โ™€ Move Fast and Break Nothing. End-to-end typesafe APIs made easy.

tRPC is a library that allows you to build and consume fully typesafe APIs without schemas or code generation. It is an to traditional REST or , designed specifically for full-stack TypeScript developers. With tRPC, you can share types directly between your client and server without relying on code generation.

tRPC provides full static type safety and auto-completion on the client for inputs, outputs, and errors. It has zero dependencies and a small client-side footprint. The library is also framework agnostic, with adapters built for popular frameworks, and supports subscriptions and request batching.

RPC (Remote Procedure Call) is a way of calling functions on one computer (the server) from another computer (the client). tRPC allows you to call functions and receive responses without considering implementation details like /REST.

To start with RPC, you'll need to install the necessary packages and set up a router. You can then define your procedures (queries, mutations, and subscriptions) and serve the using an adapter. Finally, you can use the RPC client to interact with the on the client side, leveraging complete type safety and auto-completion.

Backlinks1