Skip to main content
The /node entrypoint installs an AsyncLocalStorage bridge for Effect FiberRefs. Use it when request-local Effect state is created outside the oRPC pipeline and should be visible inside procedures.

Passive bridge

Import the Node entrypoint for continuity across internal effect-orpc runtime boundaries.
entry.ts
import "effect-orpc/node";

Active bridge with withFiberContext

Use withFiberContext when framework middleware runs an outer Effect and then calls into oRPC.
middleware.ts
import { Effect } from "effect";
import { withFiberContext } from "effect-orpc/node";

app.use("*", async (c, next) => {
  await Effect.runPromise(
    Effect.gen(function* () {
      yield* Effect.annotateLogsScoped({
        requestId: c.req.header("x-request-id") ?? crypto.randomUUID(),
      });

      yield* withFiberContext(() => next());
    }),
  );
});

Priority rules

When a captured fiber context and the application runtime both provide the same service, effect-orpc prioritizes the captured request context. That makes the application runtime the base layer while request-local annotations, tracing context, or scoped overrides win for the current request.

When not to use it

You do not need the Node bridge if:
  • all request-local services are provided inside the effect-orpc builder pipeline
  • you are not using Node
  • you do not rely on request-local FiberRef state outside oRPC

Next step

See the Hono guide for a concrete framework integration.
Last modified on June 15, 2026