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
| tRPC | Silgi |
|---|---|
query procedure | ProcedureDef (GET) |
mutation procedure | ProcedureDef (POST) |
subscription procedure | subscription ProcedureDef |
| Input schemas (Zod) | Passed through as-is |
| Nested routers | Nested RouterDef |
What doesn't convert
- tRPC middleware runs inside tRPC, not Silgi's guard/wrap pipeline
- tRPC context — use Silgi's
contextfactory 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
- Convert with
fromTRPC()— everything works immediately - Rewrite procedures one by one to native Silgi (add guards, wraps, typed errors)
- Remove tRPC dependency when done
What's next?
- Getting Started — Silgi from scratch
- Middleware — guards and wraps (Silgi's equivalent of tRPC middleware)
- Integrations — other available integrations