trpc

Build type-safe tRPC APIs with shared client and server types.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Dsantiagomj/DSMJ-Ai-Toolkit --skill trpc-dsantiagomj
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: trpc
Source: https://github.com/Dsantiagomj/DSMJ-Ai-Toolkit/tree/main/skills/stack/trpc
Command: npx skills add https://github.com/Dsantiagomj/DSMJ-Ai-Toolkit --skill trpc-dsantiagomj

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill empowers teams to build fully type-safe APIs that share types directly between client and server without code generation, reducing boilerplate and runtime errors.

Core Features & Use Cases

  • Unified Type Safety: Shared types across frontend and backend in a single TypeScript context.
  • Zero-Codegen API: No OpenAPI schemas or code generation steps; APIs are defined with routers and procedures.
  • React Query Integration: Built-in integration for caching, invalidation, and optimistic UI within React.
  • Use Case: Build a Next.js app where API routes and UI components share the same input/output contracts, improving DX and safety.

Quick Start

Set up a TypeScript project, install the tRPC packages, and expose a sample router to verify type-safe API calls.

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 in TypeScript without code generation?

Type-safe APIs without codegen are built using tRPC routers and procedures, sharing types directly between client and server. This eliminates OpenAPI schemas and reduces boilerplate while ensuring unified type safety.

How does tRPC integrate with React Query for data fetching?

tRPC integrates with React Query to provide built-in mechanisms for data caching, invalidation, and optimistic UI updates. This leverages shared TypeScript types to ensure type-safe API calls within React components.

Can I share API input validation logic between Next.js client and server?

Yes, you can share input validation logic by defining it within tRPC procedures. Both the Next.js client and server share the same TypeScript context, ensuring validation schemas are unified across your full-stack application.

What is the best way to structure context sharing in a full-stack TypeScript app?

The best way to structure context sharing is by using tRPC to pass shared context across procedures and middleware. This maintains end-to-end type safety across your full-stack TypeScript environment without requiring code generation.

Does tRPC require OpenAPI schemas to define API routes?

No, tRPC does not require OpenAPI schemas or any code generation steps. APIs are defined programmatically using routers and procedures, providing a unified TypeScript environment for both client and server.

How do I set up a tRPC router in a Next.js project?

To set up a tRPC router in a Next.js project, install the tRPC packages and expose a sample router to verify type-safe API calls. This enables zero-codegen APIs with shared input and output contracts across your application.