orpc is a free, open source api development & testing project written in TypeScript and released under MIT. It has 5,628 GitHub stars, 170 forks and 27 open issues, and was last pushed 12 hours ago. On this registry it ranks #43 of 103 tracked projects in API Development & Testing, with 5 head-to-head comparisons available. It gained 6 stars over the last 3 tracked days.

What is orpc?

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.

project readme (upstream, from github) β€” read inline

oRPC - Typesafe APIs Made Simple πŸͺ„

codecov weekly downloads CodSpeed MIT License Discord Ask DeepWiki

Documentation

You can read the documentation here.

Packages

Core

Package Purpose Docs
@orpc/contract Define API contract as the single source of truth. Procedure Contract, Contract Router, Implementation, Generate from OpenAPI
@orpc/server Build APIs or implement contracts. Procedure, Router, Middleware, Context, RPC Handler
@orpc/client Consume APIs with end-to-end type safety. Client-Side Clients, Server-Side Clients, RPC Link, Error Handling
@orpc/openapi Add OpenAPI compatibility to APIs. OpenAPI Handler, OpenAPI Link, Specification, Scalar

Schema validation

Package Purpose Docs
@orpc/zod Integrate with Zod. Zod
@orpc/valibot Integrate with Valibot. Valibot
@orpc/arktype Integrate with ArkType. ArkType

Built-in features

Package Purpose Docs
@orpc/publisher Pub/Sub with memory, Redis, and Upstash adapters. Publisher
@orpc/ratelimit Rate limiting with memory, Redis, and Upstash adapters. Rate Limit
@orpc/experimental-lock Locking with memory, Redis, and Upstash adapters. Lock
@orpc/hibernation Leverage Hibernation APIs like Cloudflare's Hibernation WebSocket. Hibernation
@orpc/json-schema Smart coercion for OpenAPI requests. Smart Coercion

Framework & ecosystem integrations

Package Purpose Docs
@orpc/next Integrate with Next.js Server Functions. Next.js
@orpc/ai-sdk Turn contracts and procedures into AI SDK tools. AI SDK
@orpc/tanstack-query Integrate with TanStack Query. TanStack Query
@orpc/pinia-colada Integrate with [Pinia Colada](htt

readme truncated β€” read the full docs on github

Frequently asked questions

Is orpc free to use?

orpc is open source under the MIT licence. There is no licence fee and no seat count β€” you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does orpc do?

Typesafe APIs Made Simple πŸͺ„

What is orpc written in?

orpc is primarily written in TypeScript. Its source is publicly available at https://github.com/middleapi/orpc, and it has 5,628 GitHub stars.