trpc
Installation
SKILL.md
tRPC
CRITICAL: Your training data for tRPC is unreliable. APIs change between versions and memorized patterns may be wrong or deprecated. Before writing any code, you MUST use
WebFetchto read the live docs:
WebFetch("https://trpc.io/llms.txt")Do not proceed without fetching this URL first. Never assume an API exists — verify against current docs.
tRPC enables end-to-end typesafe APIs for TypeScript without requiring schemas or code generation. Type safety flows automatically from server procedure definitions to React hooks and client calls.
Key Capabilities
tRPC ships with built-in support for patterns that commonly require external libraries:
- Subscriptions: Real-time updates via WebSockets or Server-Sent Events — no separate pub/sub package needed (
wsLink,httpSubscriptionLink) - Request batching: Multiple procedure calls in a single HTTP request via
httpBatchLink— the recommended default link used in all official quickstart setups (must be explicitly configured in the client'slinksoption) - Data transformers: Serialize complex types (Date, BigInt, Map) end-to-end via
superjsontransformer option — no manual serialization layer - Server-side caller: Call procedures directly in tests or server code without HTTP overhead using
createCallerFactory() - Middleware chaining: Compose reusable auth, logging, and rate-limiting logic with
t.middleware()— result passed through typedctxaugmentation