interface RouterContext {
    allowedOrigins: readonly string[];
    cors?: Record<string, string>;
    env: Env;
    newId: (() => string);
    now: (() => number);
    ports: Ports;
    principal?: null | string;
    signer: KeyPair;
}

Properties

allowedOrigins: readonly string[]
cors?: Record<string, string>

CORS headers computed by the Worker (credentialed, exact origin). Overrides the router default.

env: Env
newId: (() => string)
now: (() => number)
ports: Ports
principal?: null | string

Principal authenticated by the Worker (passkey session or admin key signature). When set it is bound as tenant-admin at platform. When undefined, demo login applies only if cp.demoAuth is on.

signer: KeyPair