RPC Adapters
The adapters that run RPC Handler and RPC Link over HTTP, WebSocket, and message ports, and where to import each one.
RPC runs over HTTP, WebSocket, and message ports. Pick the adapter for your transport, then import RPC Handler or RPC Link from it. The router stays the same.
Server Adapters
| Adapter | Import RPCHandler from |
|---|---|
| Fetch API | @orpc/server/fetch |
| Node HTTP | @orpc/server/node |
| Fastify | @orpc/server/fastify |
| AWS Lambda | @orpc/server/aws-lambda |
| WebSocket | @orpc/server/websocket, or @orpc/server/crossws as experimental_RPCHandler |
| Message Port | @orpc/server/message-port |
Client Adapters
| Adapter | Import RPCLink from |
Calls |
|---|---|---|
| Fetch API | @orpc/client/fetch |
Any HTTP server adapter |
| WebSocket | @orpc/client/websocket |
WebSocket server adapters |
| Message Port | @orpc/client/message-port |
Message Port adapter |
Frameworks and Platforms
Framework and platform adapters build on the ones above, such as Next.js and Hono on the Fetch API, Express.js on Node HTTP, and Electron and Web Workers on Message Port. See Adapters for the full list.