🔌tRPC
Also known as TypeScript Remote Procedure Call, tRPC API, tRPC Router
A TypeScript tool. The front end calls server code, and both share the same types.
Think of it like
Think of it like a phone where both people speak the same language. Nothing gets lost in translation.
Example
Emma renames a field on her server. Her editor at once marks every front-end line that used the old name.
Why it matters
Mistakes between front end and back end show up while you type, not after you ship.
Definition
Example code
typescript
const order = await trpc.order.byId.query({ id: 42 });
console.log(order.total);Common mistake
Key takeaways
- 1Shared types. Both sides see the same shapes.
- 2No schema file. The code is the contract.
- 3TypeScript only. Best when one team owns both ends.