Sanity Library Reference Docs
    Preparing search index...

    Interface InitializedClientConfig

    interface InitializedClientConfig {
        allowReconfigure?: boolean;
        apiHost: string;
        apiVersion: string;
        cdnUrl: string;
        dataset?: string;
        fetch?: boolean | { cache?: undefined; next?: undefined };
        headers?: Record<string, string>;
        ignoreBrowserTokenWarning?: boolean;
        isDefaultApi: boolean;
        maxRetries?: number;
        perspective?: ClientPerspective;
        projectId?: string;
        proxy?: string;
        requester?: Requester;
        requestTagPrefix?: string;
        resultSourceMap?: boolean | "withKeyArraySelector";
        retryDelay?: (attemptNumber: number) => number;
        stega: InitializedStegaConfig;
        timeout?: number;
        token?: string;
        url: string;
        useCdn: boolean;
        useProjectHostname: boolean;
        withCredentials?: boolean;
    }

    Hierarchy (View Summary)

    Index

    Properties

    allowReconfigure?: boolean
    apiHost: string
    apiVersion: string
    cdnUrl: string

    Internal, don't use

    dataset?: string
    fetch?: boolean | { cache?: undefined; next?: undefined }

    set cache and next options on client.fetch instead

    headers?: Record<string, string>

    Default headers to include with all requests

    request-specific headers will override any default headers with the same name.

    ignoreBrowserTokenWarning?: boolean
    isDefaultApi: boolean

    Internal, don't use

    maxRetries?: number

    Number of retries for requests. Defaults to 5.

    perspective?: ClientPerspective

    What perspective to use for the client. See documentation

    As of API version v2025-02-19, the default perspective has changed from raw to published. https://www.sanity.io/changelog/676aaa9d-2da6-44fb-abe5-580f28047c10|Changelog

    'published'
    
    projectId?: string
    proxy?: string
    requester?: Requester

    Don't use

    requestTagPrefix?: string

    Optional request tag prefix for all request tags

    resultSourceMap?: boolean | "withKeyArraySelector"

    Adds a resultSourceMap key to the API response, with the type ContentSourceMap

    retryDelay?: (attemptNumber: number) => number

    The amount of time, in milliseconds, to wait before retrying, given an attemptNumber (starting at 0).

    Defaults to exponential back-off, starting at 100ms, doubling for each attempt, together with random jitter between 0 and 100 milliseconds. More specifically the following algorithm is used:

    Delay = 100 * 2^attemptNumber + randomNumberBetween0and100

    The fully initialized stega config, can be used to check if stega is enabled

    timeout?: number
    token?: string
    url: string

    Internal, don't use

    useCdn: boolean
    true
    
    useProjectHostname: boolean

    Don't use

    withCredentials?: boolean