adapter-fastify

Mount a tRPC router onto a Fastify server with WebSocket subscriptions.

2|Updated Apr 11, 2026
One-click install
npx skills add https://github.com/PlazaCC/antes-da-tela --skill adapter-fastify
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: adapter-fastify
Source: https://github.com/PlazaCC/antes-da-tela/tree/main/.agents/skills/adapter-fastify
Command: npx skills add https://github.com/PlazaCC/antes-da-tela --skill adapter-fastify

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Manually wiring tRPC into a Fastify server requires configuring the plugin, handling batch request limits, enabling WebSocket subscriptions, and ensuring type‑safe error handling, which can be error‑prone and time‑consuming.

Core Features & Use Cases

  • Provides a Fastify plugin that mounts a tRPC router at a configurable prefix.
  • Supports WebSocket subscriptions via @fastify/websocket for real‑time features.
  • Allows batch request size control with maxParamLength and maxBatchSize settings.
  • Ensures type‑safe onError handling using TypeScript's satisfies operator.
  • Ideal for building Node.js backend services that need a performant, type‑safe RPC layer.

Quick Start

Use the adapter-fastify skill to mount your tRPC router on a Fastify server at the /trpc endpoint.

Frequently Asked Questions about adapter-fastify

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

FAQPage Schema
How do I mount a tRPC router on a Fastify server?▼

To mount a tRPC router on a Fastify server, apply a Fastify plugin that maps the router to a configurable prefix. This provides fast API handling with type-safe error management for Node.js backend services.

Can I use WebSocket subscriptions with tRPC and Fastify?▼

Yes, WebSocket subscriptions are supported with tRPC and Fastify by integrating the optional @fastify/websocket plugin. This enables real-time features directly within your Node.js tRPC backend service.

What's the best way to handle tRPC batch request limits in Node.js?▼

Handling tRPC batch request limits in Node.js is done by configuring maxParamLength and maxBatchSize settings within your Fastify plugin. This controls batch sizes during fast API request processing.

Do I need TypeScript to ensure type-safe error handling in tRPC?▼

TypeScript is needed to ensure type-safe error handling in tRPC by utilizing the satisfies operator for the onError configuration. This guarantees type safety when mounting routers on a Fastify server.

Does the tRPC Fastify adapter work with Fastify v5?▼

The tRPC Fastify adapter works with Fastify v5+ and @trpc/server v11+. It requires these versions to properly mount the router and provide fast API handling and optional WebSocket subscriptions in Node.js.