oRPC is an MIT-licensed TypeScript toolkit for building and consuming end-to-end typesafe APIs, aimed at TypeScript developers on Node.js, Bun, Deno, Next.js, React, SolidJS, Vue/Pinia, and Cloudflare Workers.
What it is
oRPC is a set of npm packages published under the @orpc scope that let a team define an API once and consume it with full type safety from either side of the wire. The core quartet is @orpc/contract for defining the API contract as the single source of truth, @orpc/server for building APIs or implementing that contract, @orpc/client for consuming them, and @orpc/openapi for adding OpenAPI compatibility. Supporting packages cover schema validation, pub/sub, rate limiting, locking, and Cloudflare-specific hibernation.
The problem it solves is drift between the server's definition of an API and the client's assumptions about it. Instead of maintaining a hand-written contract alongside the implementation and hoping the two stay aligned, the contract itself drives both sides, and a contract can also be generated from an existing OpenAPI specification. It lives in the TypeScript ecosystem, where contract-first RPC is an alternative to keeping REST route definitions and client call sites in sync by convention.
Key capabilities
@orpc/contract defines the API contract as the single source of truth, with Procedure Contract, Contract Router, and Implementation docs, plus generation from OpenAPI.
@orpc/server builds APIs or implements contracts through Procedure, Router, Middleware, Context, and an RPC Handler.
@orpc/client consumes APIs with end-to-end type safety, offering Client-Side Clients, Server-Side Clients, RPC Link, and error handling.
@orpc/openapi adds OpenAPI compatibility via an OpenAPI Handler, OpenAPI Link, specification output, and Scalar for documentation.
- Schema validation integrates with
@orpc/zod, @orpc/valibot, and @orpc/arktype.
@orpc/publisher provides pub/sub and @orpc/ratelimit provides rate limiting, both with memory, Redis, and Upstash adapters; @orpc/experimental-lock does the same for locking.
@orpc/hibernation uses Cloudflare's Hibernation WebSocket API, and @orpc/json-schema adds smart coercion for OpenAPI requests.
Who uses it and how
- Teams running TypeScript backends on Node.js, Bun, or Deno that want one contract shared by server and client.
- Cloudflare Workers projects that need durable WebSocket connections, using
@orpc/hibernation for the Hibernation WebSocket API.
- Full-stack Next.js applications, where the same contract feeds React, SolidJS, or Vue/Pinia clients.
- Teams that already publish OpenAPI and want to generate the oRPC contract from it rather than maintain two definitions.
- Services needing pub/sub, rate limiting, or locking alongside their API, wired to Redis or Upstash when memory adapters are not enough.
Getting started
Install the packages from npm, for example @orpc/contract, @orpc/server, and @orpc/client, and follow the guides at https://orpc.dev. No Docker image, compose file, or hosted option appears in the facts.
How it compares
The facts name no paid products that this project replaces, and no directly comparable tools. oRPC stands alone in this registry on the evidence provided.
When to use it β and when not to
A self-hoster must operate a Node.js, Bun, or Deno server, and needs Redis or Upstash if pub/sub, rate limiting, or locking should survive beyond a single process; no database or SMTP requirement is stated. Teams not working in TypeScript should look elsewhere. The README is essentially a package table that defers to https://orpc.dev for everything substantive, @orpc/experimental-lock is explicitly experimental, and the repository carries 27 open issues.