Beignet API reference
    Preparing search index...

    Type Alias CreateOutboxDrainRouteOptions<Ctx>

    Options for creating a serverless-safe outbox drain route.

    type CreateOutboxDrainRouteOptions<Ctx extends OutboxDrainContext> = {
        batchSize?: number;
        headers?: HeadersInit | ((req: Request) => HeadersInit | undefined);
        leaseMs?: number;
        pipeline?: {
            metadata?: RawRouteInit["metadata"];
            name?: string;
            path?: string;
        };
        registry: OutboxRegistry;
        retryDelayMs?: DrainOutboxOptions["retryDelayMs"];
        secret?: string;
        server: ServerSource<NextRouteServer<Ctx>>;
    }

    Type Parameters

    • Ctx extends OutboxDrainContext
    Index
    batchSize?: number

    Maximum messages to claim in one drain pass.

    headers?: HeadersInit | ((req: Request) => HeadersInit | undefined)

    Additional response headers.

    leaseMs?: number

    Claim lease duration in milliseconds.

    pipeline?: { metadata?: RawRouteInit["metadata"]; name?: string; path?: string }

    Identity and metadata for the hooks pipeline when the server exposes rawRoute(...). metadata feeds metadata-driven hooks such as rate limiting and idempotency; name and path identify the route to hooks, instrumentation, and devtools.

    registry: OutboxRegistry

    Registry of events and jobs that may be delivered from the outbox.

    Retry delay override passed through to drainOutbox(...).

    secret?: string

    Shared secret expected in the Authorization: Bearer <secret> header.

    Missing secrets fail closed with a 500 response so deployments do not accidentally expose an unauthenticated drain route.

    server: ServerSource<NextRouteServer<Ctx>>

    Beignet server that owns app context and ports.

    Any object exposing createRequestContext works: a NextServer, a core ServerInstance, or a test fake driven from a standard test runner.