tRPC

Build type-safe APIs with end-to-end TypeScript inference in Next.js projects.

17|4|Updated Oct 21, 2025
One-click install
npx skills add https://github.com/oriolrius/pki-manager-web --skill trpc-oriolrius
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tRPC
Source: https://github.com/oriolrius/pki-manager-web/tree/main/.claude/skills/trpc
Command: npx skills add https://github.com/oriolrius/pki-manager-web --skill trpc-oriolrius

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

tRPC enables building fully type-safe APIs without code generation, letting TypeScript types flow from server to client.

Core Features & Use Cases

  • End-to-end type inference: TypeScript types flow from server to client without codegen.
  • No code generation needed: Develop APIs without scaffolding steps.
  • Next.js integration: Smooth integration with Next.js app router and API routes.
  • Middleware & context: Shared auth and utilities via middleware and context.

Quick Start

Create a type-safe tRPC router and client in a Next.js app.

Frequently Asked Questions about tRPC

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

FAQPage Schema
How do I build type-safe APIs without code generation?

Setting up a tRPC router enables TypeScript types to flow automatically from server to client. By defining procedures, middleware, and context server-side, your React client receives full type inference without requiring code generation steps.

How does tRPC integrate with Next.js app router and API routes?

tRPC integrates with Next.js by applying your router to API routes and consuming procedures within the app router. This connection enables smooth end-to-end TypeScript inference between Next.js server and client components without manual schema definitions.

Can I share authentication and utilities using middleware and context in tRPC?

tRPC enables sharing authentication and utilities by defining context and applying middleware. Context passes shared server-side data into procedures, while middleware intercepts requests for auth checks, maintaining full type safety across the API lifecycle.

What is the best way to achieve end-to-end type inference between server and client?

tRPC provides end-to-end type inference by letting TypeScript types flow from server routers directly to client functions. Defining procedures server-side automatically infers input and output types on the client without schema codegen or synchronization.

Do I need schemas or scaffolding to maintain TypeScript type safety in APIs?

No, you do not need schemas or scaffolding steps. tRPC enables fully type-safe APIs without code generation by inferring TypeScript types directly from your server router and procedures, ensuring client integration remains type-safe automatically.