HelloStack
Website
orpc.dev
GitHub stars
5.8k
Social media
@middleapi

About oRPC

oRPC helps TypeScript backend and frontend teams build APIs with a shared contract: the server router supplies types to clients without code generation, and can also produce REST endpoints and an OpenAPI document. It combines typed RPC calls with an HTTP-facing API, so the same procedures can serve both.

oRPC screenshot

Key Features

The contract can define data shapes and behavior for both typed clients and outside consumers:

Typed client

Calls mirror the server router, with input and return types inferred from handlers.

Contract and typed errors

Define inputs, outputs, and declared error variants so client code can handle known errors by type.

REST and OpenAPI

Add method and path metadata to procedures, then generate an OpenAPI document from the router or contract.

Middleware

Inject context such as an authenticated user; handlers receive it with its type checked.

Realtime streams

Expose typed streaming procedures alongside HTTP and WebSocket transports.

Worth Knowing

Check these implementation details before choosing a version or client runtime:

  • The v2 migration guide instructs users to install @orpc/server@beta and @orpc/client@beta. [1]
  • React Native requires Web Streams setup; React Native versions before 0.78 cannot load oRPC, and its built-in fetch does not support streaming. [2]

Who It's For

Best for TypeScript teams building internal APIs, shared frontend-backend clients, or REST APIs that need generated OpenAPI documentation.

Alternatives to oRPC

See all →

Sources

  1. [1] Migrating from oRPC v1
  2. [2] Runtime Requirements