effect-orpc connects oRPC and Effect without making either side feel foreign.
This version covers the
effect-orpc@effect-v4 prerelease line for Effect 4.Quickstart
Build a oRPC router with an Effect service, a typed input, and an Effect-native error.
Mental model
Understand builders, runtimes, services, handlers, and error boundaries.\
What it adds to oRPC
effect-orpc extends the normal oRPC builder experience with Effect-aware capabilities:
- Effect generator and Effect-returning handlers with
.effect(...) - Type-safe Effect service requirements from
.provide(...) - Request-scoped service providers from request context and input
- Effect-native middleware that can yield services or return Effects
- Tagged Effect errors that become oRPC errors
- Automatic Effect spans around procedure execution
What it adds to Effect
effect-orpc gives Effect applications a typed RPC surface:
- oRPC routers and nested procedure trees
- oRPC contracts through
eocandimplementEffect - Schema-driven input and output validation
- Typed client-visible errors
- HTTP route and OpenAPI metadata
- Compatibility with standard oRPC procedures in the same router
These docs assume you already know Effect basics. If you’re new to Effect,
checkout the wonderful effect.solutions for a quick
start.
First path through the docs
1
Install the package
Start with the peer dependencies and basic imports in
Installation.
2
Build one router
Follow Quickstart to create one
Effect procedure.
3
Deepen by capability
Move through Effect procedures,
service injection, and typed
errors.
4
Add guides when needed
Use Guides for Hono, Node bridge, OpenTelemetry,
testing, and examples.