// the find
middleapi/orpc
Typesafe APIs Made Simple 🪄
oRPC is a TypeScript RPC framework that generates OpenAPI specs as a first-class output, not an afterthought. It sits between tRPC (pure type safety, no HTTP contract) and ts-rest (contract-first but more ceremony) — you can define procedures directly or define a contract first, and the same router serves both RPC clients and OpenAPI consumers. Aimed at TypeScript teams who want end-to-end type safety but also need a real REST API that other tools can talk to.
1. The contract-first mode is genuinely useful: you can share the `@orpc/contract` package with API consumers who generate their own clients via Hey API or similar, without coupling them to the oRPC client. 2. Native type serialization (Date, File, Blob, BigInt) over the wire without needing superjson as a separate concern — the RPC serializer handles it. 3. Lazy router support for cold-start-sensitive environments like Cloudflare Workers is a real operational win, not just a checkbox. 4. Test coverage is extensive — nearly every module has a `.test.ts` and `.test-d.ts` pair, meaning type-level correctness is tested alongside runtime behavior.
1. The package count is high (15+ packages) for what is conceptually one framework — adopters will hit versioning coordination pain as these evolve at different rates. 2. OpenAPI generation depends on schema converters (`ZodToJsonSchemaConverter`, etc.) that are separate packages; if your schema library isn't explicitly supported, you're writing a converter yourself. 3. The middleware and interceptor model is underdocumented relative to its complexity — the distinction between a plugin, middleware, and interceptor is not obvious from the README, and getting auth right requires reading several doc pages. 4. No server-sent mutation / invalidation story out of the box; SSE is supported for streaming but integrating it with TanStack Query's cache invalidation requires wiring it yourself.