effect-orpc as a thin Effect-aware layer around oRPC.
It does not replace oRPC. It lets you keep oRPC’s routing, validation, contracts, middleware, and client surface while using Effect for implementation logic.
Core pieces
| Piece | Role |
|---|---|
eos | Default Effect-aware oRPC builder. |
.provide(layer) | Provides base Effect services to downstream middleware and handlers. |
.provide(tag, fn) | Builds a request-scoped service from oRPC context and input. |
.effect(handler) | Defines a procedure handler as a generator or Effect-returning callback. |
ORPCTaggedError | Defines yieldable Effect errors that map to oRPC errors. |
makeEffectORPC(runtime) | Uses a caller-owned ManagedRuntime instead of acquiring a layer per call. |
Builder-first flow
Most applications start by creating a reusable procedure builder:procedure.ts
users.ts
Runtime boundaries
Effect-native steps are batched into one runtime boundary, soEffect.runPromiseExit runs only once when possible. Effect-native steps include .provide(...), .provideOptional(...), generator middleware, Effect-returning middleware, and .effect(...) handlers.
one-boundary.ts
effect-orpc carries current Effect context through native oRPC continuations and merges it into the next Effect boundary. Use the Node bridge guide when request-local Effect state must cross those split boundaries in Node.