@avvyr/storefront-sdk - v0.19.0
    Preparing search index...

    Interface RequestContext

    Mutable context for an outgoing request. Request interceptors receive this and may mutate any field in place (headers, body, params, url, meta) to influence the request before it is sent.

    interface RequestContext {
        body?: unknown;
        headers: Record<string, string>;
        keepalive?: boolean;
        meta: Record<string, unknown>;
        method: string;
        params?: Record<string, unknown>;
        path: string;
        signal?: AbortSignal;
        url: string;
    }
    Index
    body?: unknown

    Request body (pre-serialization). Mutate to rewrite the payload.

    headers: Record<string, string>

    Outgoing headers. Mutate to add/remove headers (auth, tracing, tenant, …).

    keepalive?: boolean

    Send with fetch(..., { keepalive: true }), so the request outlives the page.

    meta: Record<string, unknown>

    Free-form bag carried request → response → error for correlation (timings, request ids, …).

    method: string

    HTTP method

    params?: Record<string, unknown>

    Query params that were used to build url (informational; mutate url to change the target)

    path: string

    Resource path relative to the market scope, e.g. "/cart/123/items"

    signal?: AbortSignal

    Abort signal for this request. Set it to bind the request to a caller's own lifetime (a cancelled navigation, a shutting-down worker).

    This does not replace the client's timeout — the two are combined, and whichever fires first aborts the request.

    url: string

    Fully-resolved request URL. This is what actually gets fetched — mutate it to retarget.