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

    Interface StorefrontClientConfig

    interface StorefrontClientConfig {
        baseUrl: string;
        fetch?: {
            (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
            (input: string | URL | Request, init?: RequestInit): Promise<Response>;
        };
        headers?: Record<string, string>;
        interceptors?: StorefrontInterceptors;
        marketId: string;
        privateKey?: string;
        publicKey: string;
        timeout?: number;
    }
    Index
    baseUrl: string

    Base URL of the Avvyr API (e.g. "https://api.avvyr.com")

    fetch?: {
        (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
        (input: string | URL | Request, init?: RequestInit): Promise<Response>;
    }

    Custom fetch implementation (defaults to global fetch)

    Type Declaration

      • (input: URL | RequestInfo, init?: RequestInit): Promise<Response>
      • Parameters

        • input: URL | RequestInfo
        • Optionalinit: RequestInit

        Returns Promise<Response>

      • (input: string | URL | Request, init?: RequestInit): Promise<Response>
      • Parameters

        • input: string | URL | Request
        • Optionalinit: RequestInit

        Returns Promise<Response>

    headers?: Record<string, string>

    Default headers to include in all requests

    interceptors?: StorefrontInterceptors

    Request/response/error interceptors registered at construction time. Equivalent to calling client.http.interceptors.*.use(...) after creation.

    marketId: string

    Market ID to scope all requests to

    privateKey?: string

    Private storefront key, sent as the x-storefront-private-key header.

    SERVER-SIDE ONLY. Never pass this in code that runs in the browser — it grants elevated access and would be readable by any end user. The client throws a StorefrontConfigError if this is set while a window global exists.

    publicKey: string

    Public storefront key, sent as the x-api-key header. Safe to expose in the browser.

    timeout?: number

    Per-request timeout in milliseconds. Defaults to 10 000.

    Without it a connection that stalls rather than fails hangs forever: fetch has no timeout of its own, so the request never settles and neither does whatever awaits it. Server-side that holds a Nitro handler — and its socket — open indefinitely, which is how a single stalled call turns into a page that never renders.

    Applies to every attempt separately, retries included, so a request that is retried after a 401 refresh gets a full budget rather than a shrinking one.

    Set 0 to disable and wait indefinitely. Only sensible for genuinely long-running calls, and never on a path that serves a page.