Skip to main content
eoc is an Effect-aware wrapper around oRPC’s oc contract builder. Use it when contract definitions should accept ORPCTaggedError classes directly in .errors(...).
import.ts
import { eoc } from "effect-orpc";

Define a contract leaf

contract.ts
const contract = {
  users: {
    get: eoc
      .errors({ UserNotFoundError })
      .input(z.object({ id: z.string() }))
      .output(z.object({ id: z.string(), name: z.string() })),
  },
};

Router-level options

contract-router.ts
const contract = eoc
  .prefix("/api")
  .tag("Users")
  .router({
    users: {
      list: eoc.route({ method: "GET", path: "/users" }).output(z.array(User)),
    },
  });

See also

Last modified on June 15, 2026