- You want to share the API contract as a standalone package (e.g., between frontend and backend monorepos).
- You are generating SDKs or OpenAPI specs from the contract alone.
- Multiple teams implement different parts of the same API.
- You want the client to depend only on the contract, not the full server code.
The two packages
| Package | Role |
|---|---|
@orpc/contract | Define the API shape (procedures, routers, error maps) without any implementation. |
@orpc/server | Implement the contract and serve requests. |
Workflow
Next steps
Defining a contract
Learn the full
oc builder API for procedures and routers.Implementing a contract
Use
implement() to build a type-safe server from your contract.