Katman
Integrations

tRPC Interop

Convert tRPC routers to Katman — incremental migration path.

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

Usage

import {  } from "katman/trpc"
import {  } from "./trpc-router"

const  = ()

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

What gets converted

tRPCKatman
query procedurequery ProcedureDef
mutation proceduremutation ProcedureDef
subscription proceduresubscription ProcedureDef
Input schemas (Zod)Passed through as-is
Nested routersNested RouterDef

What doesn't convert

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

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

Migration strategy

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

What's next?

On this page