trpc

31 mods across 1 repository, 41k stars between them.

server-side-calls

25

trpc/trpc

Skill Claude CodeCodex

Call tRPC procedures directly from server code using t.createCallerFactory() and router.createCaller(context) for integration testing, internal server logic, and custom API endpoints. Catch TRPCError and extract HTTP status with getHTTPStatusCodeFromError(). Error handling via onError option.

41k 18d ago A 61 tokens original MIT

trpc/trpc

Skill Claude CodeCodex

Break a tRPC backend into multiple services with custom routing links that split on the first path segment (op.path.split('.')) to route to different backend service URLs. Define a faux gateway router that merges service routers for the AppRouter type without running them in the same process. Share procedure and…

41k 18d ago A 91 tokens original MIT

subscriptions

27

trpc/trpc

Skill Claude CodeCodex

Set up real-time event streams with async generator subscriptions using .subscription(async function() { yield }). SSE via httpSubscriptionLink is recommended over WebSocket. Use tracked(id, data) from @trpc/server for reconnection recovery with lastEventId. WebSocket via wsLink and createWSClient from @trpc/client…

41k 18d ago A 118 tokens original MIT

trpc-router

28

trpc/trpc

Skill Claude CodeCodex

Entry point for all tRPC skills. Decision tree routing by task: initTRPC.create(), t.router(), t.procedure, createTRPCClient, adapters, subscriptions, React Query, Next.js, links, middleware, validators, error handling, caching, FormData.

41k 18d ago A 59 tokens original MIT

validators

29

trpc/trpc

Skill Claude CodeCodex

Configure input and output validation with .input() and .output() using Zod, Yup, Superstruct, ArkType, Valibot, Effect, or custom validator functions. Chain multiple .input() calls to merge object schemas. Standard Schema protocol support. Output validation returns INTERNALSERVERERROR on failure.

41k 18d ago A 63 tokens original MIT

trpc/trpc

Skill Claude CodeCodex

Migrate from @trpc/react-query (classic) to @trpc/tanstack-react-query. Run npx @trpc/upgrade CLI for automated codemod. Manually migrate remaining patterns: hook-based to options-factory, utils.invalidate to queryClient.invalidateQueries with queryFilter, provider changes.

41k 18d ago A 70 tokens original MIT

react-query-setup

31

trpc/trpc

Skill Claude CodeCodex

Set up @trpc/tanstack-react-query with createTRPCContext(), TRPCProvider, useTRPC() hook, queryOptions/mutationOptions factories, query invalidation via queryClient.invalidateQueries with queryFilter, and type inference with inferInput/inferOutput.

41k 18d ago A 60 tokens original MIT