Skip to content
You are reading the v2 docs, currently in beta.V1 docs
oRPC
Esc
↑↓navigate↵open⌘Jpreview
On this page

OpenAPI Adapters

The HTTP adapters that run OpenAPI Handler and OpenAPI Link, and where to import each one.

OpenAPI runs over HTTP only. Pick the adapter for your server, then import OpenAPI Handler from it. For WebSocket or message ports, use RPC.

Server Adapters

Adapter Import OpenAPIHandler from
Fetch API @orpc/openapi/fetch
Node HTTP @orpc/openapi/node
Fastify @orpc/openapi/fastify
AWS Lambda @orpc/openapi/aws-lambda

Client Adapter

OpenAPI Link uses the Fetch API adapter: import OpenAPILink from @orpc/openapi/fetch. It calls any server adapter above, or any other OpenAPI-compliant server.

Frameworks and Platforms

Every framework and platform adapter built on the Fetch API or Node HTTP also serves OpenAPI, such as Next.js, Hono, Express.js, and Cloudflare Workers. Where an example uses RPCHandler, swap in OpenAPIHandler from the matching import above. See Adapters for the full list.

Last updated on

Was this page helpful?