Getting Started
A quick look at tRPC
For a quick video overview of tRPC's concepts, check out the videos below:
Give tRPC a try
The fastest way to try tRPC is in an online REPL. Here are some options you can try out:
- Minimal Example - a minimal Node.js http server, and a client that calls a function on the server and logs the request to the console.
- Minimal Next.js Example - the smallest possible Next.js app that uses tRPC. It has a single endpoint that returns a string, and a page that calls that endpoint and displays the result.
If you prefer to get started in your local environment, you can use one of our example apps as a starter project that you can experiment with locally.
Use tRPC
"Using tRPC" means different things to different people. The goal of this page is to guide you to the right resources based on your goals.
Becoming productive in an existing tRPC project
- Read the concepts page.
- Become familiar with routers, procedures, context, and middleware.
- If you are using React, read about useQuery, useMutation and useUtils.
Creating a new project
Since tRPC can live inside of many different frameworks, you will first need to decide where you want to use it.
On the backend, there are adapters for a range of frameworks as well as vanilla Node.js. On the frontend, you can use our React or Next.js integrations, a third-party integration for a variety of other frameworks, or the Vanilla Client, which works anywhere JavaScript runs.
After choosing your stack, you can either scaffold your app using a template, or start from scratch using the documentation for your chosen backend and frontend integration.
Adding tRPC to an existing project
Adding tRPC to an existing project is not significantly different from starting a new project, so the same resources apply. The main challenge is that it can feel difficult to know how to integrate tRPC with your existing application. Here are some tips:
- You don't need to port all of your existing backend logic to tRPC. A common migration strategy is to initally only use tRPC for new endpoints, and only later migrate existing endpoints to tRPC.
- If you're not sure where to start, check the documentation for your backend adapter and frontend implementation, as well as the example apps.
- If you are looking for some inspiration of how tRPC might look as part of a larger codebase, there are some examples in Open-source projects using tRPC.
Join our Community
Join us in the tRPC Discord to share your experiences, ask questions, and get help from the community!