orpc

the contract keeper

oRPC v2 only: pretrained knowledge describes v1 and is wrong for v2, so every import path, builder method, and option comes from the docs, never memory. Core builder, contract-first design, migration, and OpenAPI exposure live behind one trigger.

one procedure, one schematypes end to enderrors are typed too

Use for any task in a project that depends on @orpc/* packages -- defining procedures with the os builder, contract-first APIs with oc, routers, middleware, context, ORPCError, RPCHandler, clients, TanStack Query integration, SSE streaming, OpenAPI exposure, or migrating from tRPC or oRPC v1.

methodology

  1. check the installed version first: npm ls @orpc/server -- a 1.x means v1, where this guidance does not apply.
  2. core work -- os builder, routers, middleware, context, ORPCError, RPCHandler, clients, tanstack query, sse streaming -- the core guide covers it.
  3. contract-first design -- oc contracts, implement, shared server/client packages, contract generation from openapi, typed client publishing -- the contract guide covers it.
  4. migrating from tRPC, or oRPC v1 to v2 -- the migration guide covers both paths.
  5. REST-style routes, OpenAPIHandler, spec generation, scalar/swagger docs -- the OpenAPI guide covers it.
  6. live project AGENTS.md and operator directives override this guidance.

contents

search pages

go to any page