Beignet API reference
    Preparing search index...

    Type Alias CreateScheduleRouteOptions<Ctx>

    Options for creating a serverless-safe schedule trigger route.

    type CreateScheduleRouteOptions<Ctx extends ScheduleRouteContext> = {
        headers?: HeadersInit | ((req: Request) => HeadersInit | undefined);
        pipeline?: {
            metadata?: RawRouteInit["metadata"];
            name?: string;
            path?: string;
        };
        schedule: string;
        schedules: readonly ScheduleDef<string, StandardSchema, Ctx>[];
        secret?: string;
        server: ServerSource<NextRouteServer<Ctx>>;
        source?: string;
    }

    Type Parameters

    • Ctx extends ScheduleRouteContext
    Index
    headers?: HeadersInit | ((req: Request) => HeadersInit | undefined)

    Additional response headers.

    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.

    schedule: string

    Name of the schedule this route triggers. Unknown names throw when the route module loads so misconfigured routes fail at build or boot time.

    schedules: readonly ScheduleDef<string, StandardSchema, Ctx>[]

    Registered schedules, usually the schedules array from server/schedules.ts.

    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 trigger 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.

    source?: string

    Run source label recorded on run metadata and devtools events.

    "next-cron-route"