trpc

Build type-safe APIs with tRPC across Next.js, Express, Fastify, Hono, and Bun.

5|Updated Jan 17, 2026
One-click install
npx skills add https://github.com/DimitriGilbert/ai-skills --skill trpc-dimitrigilbert
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: trpc
Source: https://github.com/DimitriGilbert/ai-skills/tree/main/trpc
Command: npx skills add https://github.com/DimitriGilbert/ai-skills --skill trpc-dimitrigilbert

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

tRPC provides end-to-end, type-safe APIs that work across Next.js, Express, Fastify, Hono, Bun and any package manager, unifying server and client code paths and removing boilerplate.

Core Features & Use Cases

  • Framework-agnostic router and procedure definitions that preserve type safety across environments.
  • Adapters and client utilities for multiple frameworks to enable seamless integration.
  • Shared AppRouter-based types between server and client with strong ergonomic error handling.
  • Real-world usage examples like healthCheck routing and nested routers for scalable APIs.

Quick Start

Install the core tRPC packages for your environment and integrate the example router into your framework.

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 that share types between frontend and backend?

Build type-safe APIs by defining framework-agnostic routers and procedures that preserve TypeScript types across server and client environments. This approach unifies code paths and removes manual boilerplate, ensuring end-to-end type safety.

Can I use tRPC with Express, Fastify, or Hono?

Yes, tRPC works with Express, Fastify, Hono, Bun, and Next.js through dedicated adapters. These adapters enable seamless integration of your type-safe routers into your existing framework setup without changing your core routing logic.

What is the best way to structure scalable type-safe API routers?

Structure scalable type-safe API routers using nested routers and shared AppRouter-based types. This pattern allows backend and frontend teams to organize complex routing hierarchies while maintaining strong ergonomic error handling and consistent developer experience.

How do I handle context and middleware in a tRPC server implementation?

Handle context and middleware by defining them within your procedure definitions to manage shared server state and request validation. This approach ensures proper routing patterns and cross-framework integration across your server implementations.

Does tRPC require a specific package manager or framework to implement procedures?

No, tRPC is framework-agnostic and works with any package manager. You can implement procedures, health checks, and error handling across Next.js, Express, Fastify, Hono, or Bun without being locked into a specific ecosystem.