oRPC is currently pre-stable, please report any issues on our Discord or GitHub 🚧
oRPC
background

Integrations

Integrating oRPC with your existing stacks, environments, and frameworks.

Integrate oRPC with various stacks, environments, and frameworks effortlessly. oRPC is designed with the Fetch API in mind, making it compatible with any modern environment or framework.

It uses the highly performant Hono RegExpRouter under the hood, ensuring low-latency routing. Whether you're targeting serverless, edge environments, or traditional backends, oRPC is optimized for all scenarios.

Quick Example

import { ,  } from '@orpc/server/fetch'
import {  } from '@orpc/openapi/fetch'
import {  } from 'examples/server'
import {  } from '@orpc/zod'
 
const  = new (, {
  : [
    new (),
  ],
})
const  = new ()
const  = new ([, ])
 
export function (: Request) {
  return .(, {
    : {},
  })
}

Node.js

import {  } from 'node:http'
import { ,  } from '@orpc/server/node'
import {  } from '@orpc/openapi/node'
import {  } from 'examples/server'
import {  } from '@orpc/zod'
 
const  = new (, {
  : [
    new (),
  ],
})
const  = new ()
const  = new ([, ])
 
const  = ((, ) => {
  return .(, , {
    : {},
  })
})
 
.(3000, () => {
  .('Server is available at http://localhost:3000')
})

Express.js

import  from 'express'
import { ,  } from '@orpc/server/node'
import {  } from '@orpc/openapi/node'
import {  } from '@orpc/server/express'
import {  } from 'examples/server'
import {  } from '@orpc/zod'
 
const  = ()
 
const  = new (, {
  : [
    new (),
  ],
})
 
const  = new ()
 
.(([, ], {
  : '/api',
}))
 
.((, , ) => {
  .(404).('Not Found')
})
 
.(3000, () => {
  .('Server is available at http://localhost:3000')
})

Hono

import {  } from 'hono'
import { ,  } from '@orpc/server/fetch'
import {  } from '@orpc/openapi/fetch'
import {  } from 'examples/server'
import {  } from '@orpc/zod'
 
const  = new (, {
  : [
    new (),
  ],
})
const  = new ()
const  = new ([, ])
 
const  = new ()
 
.('/api/*', () => {
  return .(.., {
    : '/api',
    : {},
  })
})
 
export default 

Next.js

app/api/[...orpc]/route.ts
import { ,  } from '@orpc/server/fetch'
import {  } from '@orpc/openapi/fetch'
import {  } from 'examples/server'
import {  } from '@orpc/zod'
 
const  = new (, {
  : [
    new (),
  ],
})
const  = new ()
const  = new ([, ])
 
export function (: Request) {
  return .(, {
    : '/api',
    : {},
  })
}
 
export const  = 
export const  = 
export const  = 
export const  = 

Cloudflare Workers

import { ,  } from '@orpc/server/fetch'
import {  } from '@orpc/openapi/fetch'
import {  } from 'examples/server'
import {  } from '@orpc/zod'
 
const  = new (, {
  : [
    new (),
  ],
})
const  = new ()
const  = new ([, ])
 
export default {
  async (: Request) {
    return .(, {
      : '/',
      : {},
    })
  },
}

Other Environments and Frameworks

oRPC works in any modern environment that supports the creating server with Fetch API.

On this page