trpc

Build and consume type-safe tRPC APIs with shared TypeScript types.

Updated Feb 3, 2026
One-click install
npx skills add https://github.com/ehyland/skills --skill trpc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: trpc
Source: https://github.com/ehyland/skills/tree/main/skills/trpc
Command: npx skills add https://github.com/ehyland/skills --skill trpc

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a framework-agnostic pattern to build and consume fully type-safe APIs between server and client using tRPC, removing the need for schemas or code generation and ensuring shared types across layers.

Core Features & Use Cases

  • Type-safe Routers & Procedures: Define routers, queries, mutations, and subscriptions with TypeScript types shared between server and client.
  • Schema-free Typing: Share input/output types without runtime schemas or codegen, enabling rapid iteration.
  • Cross-environment Support: Works in Node and browser contexts, ideal for monorepos, Next.js APIs, and microservices.
  • Use Case: Build a single source of truth for API contracts in a full-stack React+Node project and evolve client/server APIs together.

Quick Start

Install core packages and scaffold a basic tRPC setup. Create a router with initTRPC, export a publicProcedure, and implement a client that calls the router endpoints.

Frequently Asked Questions about trpc

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a type-safe API without writing schemas or code generation?

tRPC enables type-safe APIs by sharing TypeScript types directly between server and client without schemas or codegen. Define routers and procedures on the server, export them as types, and call them from the client with full type inference and autocomplete.

Can I use tRPC with Next.js and React?

Yes, tRPC works across Node and browser contexts, making it ideal for full-stack projects like Next.js with React clients. You define API routers in your backend and consume them in React components with end-to-end type safety.

How do I set up a tRPC router with queries and mutations?

Initialize tRPC with initTRPC, create a publicProcedure, define routers with queries and mutations using input and output types, then export the router. Set up a client that connects to your router endpoints and automatically infers all types.

What's the difference between tRPC and REST or GraphQL APIs?

tRPC eliminates schema files and code generation by using TypeScript types as your single source of truth. Unlike REST or GraphQL, you share types directly between layers, enabling rapid iteration and immediate feedback when API contracts change.

Do I need a database or ORM to use tRPC?

No, tRPC is framework-agnostic and focuses on the API contract layer. You can pair it with any database, ORM, or data source—it handles type-safe communication between client and server regardless of your backend persistence layer.

Can tRPC routers support subscriptions and middleware?

Yes, tRPC routers support queries, mutations, and subscriptions. You can also add middleware to handle authentication, logging, and context setup, giving you full control over request lifecycle and type-safe access to shared context.