Anchorage API reference
    Preparing search index...

    Class HubDurableObject<TEnv>Abstract

    Per-tenant hub Durable Object base. Hosts subclass it (ShowcaseHub / FlowsafeHub / DemoHub) and bind it under the wrangler HUB namespace; the subclass body is typically empty. Left abstract to signal "extend, do not instantiate directly".

    Type Parameters

    • TEnv = unknown
    Index

    Constructors

    Properties

    env: TEnv

    Absent in node tests; present under workerd (Hibernatable-WebSocket API).

    Accessors

    • get tenantId(): string

      The tenant this hub serves, recovered from the DO's OWN identity. The trusted Worker addressed this instance via idFromName(tenantId), so id.name IS the bare tenantId (no ':' join, no runId decode). id.name is populated only for idFromName-created ids and is unforgeable at this boundary.

      THROWS rather than defaulting — a hub that cannot resolve its tenant must refuse to fan out, never fan one tenant's event to another's sockets. Mirrors DurableObjectRunner.tenantId's fail-closed posture.

      Returns string

    Methods