tRPC enables end-to-end type-safe APIs by sharing TypeScript types between server and client without code generation or schemas. The server defines procedures (queries, mutations, subscriptions) in a router, and the client infers all types from the exported AppRouter type.
When to use: TypeScript full-stack apps needing type-safe API layers, monorepos sharing types, real-time subscriptions, rapid API iteration without OpenAPI/GraphQL overhead.
When NOT to use: Public APIs consumed by non-TypeScript clients (use REST/GraphQL), polyglot backends, projects requiring OpenAPI spec generation as primary output.
tRPC v11 TypeScript용 엔드 투 엔드 유형 안전 API입니다. 라우터 및 프로시저 정의, Zod를 사용한 입력 검증, 미들웨어 및 컨텍스트, 구독, TRPCError를 사용한 오류 처리, @trpc/react-query를 통한 React 클라이언트 후크, createCallerFactory를 사용한 서버 측 호출자, 어댑터 설정(독립형, Express, Fastify, Hono) 및 테스트 패턴을 다룹니다. tRPC 라우터 구축, 절차 정의, 미들웨어 설정, 어댑터 구성, tRPC와 React 통합, 오류 처리, 구독 구현 또는 tRPC 절차 테스트 시 사용합니다. 출처: oakoss/agent-skills.