Skip to content
Back to skills

Trpc

ASecurity

tRPC — end-to-end type-safe APIs with routers, procedures, middleware, context, React Query.

  • 47 stars
  • 0 votes
  • 0 copies
  • 7 views
  • Added September 12, 2026
testingreactnextjsnodeexpressawsapi

Works with

  • cli
  • api

Security analysis

A100/100

Scanned September 12, 2026

npx -y skills add skeletorflet/opencode-supreme-setup --skill trpc --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Trpc?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Trpc
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/skeletorflet-trpc/badge)](https://www.skillsdirectory.com/skills/skeletorflet-trpc)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: trpc
description: tRPC — end-to-end type-safe APIs with routers, procedures, middleware, context, React Query.
---

## trpc

### Routers & Procedures
- `t.router({ user: t.procedure.query(...) })` — define API surface.
- Procedures: `.query()` for reads, `.mutation()` for writes, `.subscription()` for real-time events.
- Input validation: `t.procedure.input(z.string()).query(...)` — auto-inferred types.
- `.output(z.object({...}))` — validate and type response shape.

### Middleware & Context
- `t.middleware(async ({ ctx, next }) => { ... return next({ ctx: enriched }) })` — pipeline.
- Context: `router.createContext()` — per-request initialization (auth, DB, session).
- Per-procedure middleware via `.use(middleware)` chaining.

### Error Handling
- `TRPCError` — `new TRPCError({ code: 'NOT_FOUND', message: '...' })` with typed codes.
- Error formatting: `router.formatError(({ shape, error }) => ...)` — customize error shape.
- Error filtering by code in client `onError` callbacks.

### React Query Integration
- Auto-generated hooks: `trpc.user.useQuery(args)`, `.useMutation()`, `.useUtils().invalidate()`.
- SSR: `trpcNext.createSSGHelpers()` or `trpcNext.withTRPC()` HOC for Next.js.
- Server-side calls: `caller = router.createCaller(ctx)` — invoke without HTTP.

### Adapters
- HTTP: `@trpc/server/adapters/express`, `@trpc/server/adapters/next`, `@trpc/server/adapters/fastify`.
- Standalone: `@trpc/server/adapters/standalone` for Node http server.
- AWS Lambda: `@trpc/server/adapters/aws-lambda`.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.