oRPC Next.js Adapter
Installation
SKILL.md
Next.js Adapter
Next.js integration. Works with App Router and Pages Router.
oRPC also supports Server Action out of the box.
Server
// app/rpc/[[...rest]]/route.ts
import { RPCHandler } from '@orpc/server/fetch'
import { onError } from '@orpc/server'
const handler = new RPCHandler(router, {
interceptors: [onError(e => console.error(e))],
})