Silgi
Integrations

tRPC Interop

Convert tRPC routers to Silgi — incremental migration path.

Migrate from tRPC to Silgi incrementally. Convert your existing tRPC router and serve it with Silgi's pipeline.

Usage

import {  } from 'silgi/trpc'
import {  } from './trpc-router'

const  = ()

// Now use with Silgi's serve(), handler(), etc.
s.serve(, { : 3000 })

What gets converted

tRPCSilgi
query procedureProcedureDef (GET)
mutation procedureProcedureDef (POST)
subscription proceduresubscription ProcedureDef
Input schemas (Zod)Passed through as-is
Nested routersNested RouterDef

What doesn't convert

  • tRPC middleware runs inside tRPC, not Silgi's guard/wrap pipeline
  • tRPC context — use Silgi's context factory instead
  • tRPC links — use Silgi's client links

fromTRPC wraps each procedure's resolver. tRPC middleware still runs inside the tRPC procedure — it's not converted to Silgi guards/wraps. For full Silgi features, rewrite procedures natively.

Migration strategy

  1. Convert with fromTRPC() — everything works immediately
  2. Rewrite procedures one by one to native Silgi (add guards, wraps, typed errors)
  3. Remove tRPC dependency when done

What's next?

On this page