Sanity Library Reference Docs
    Preparing search index...

    Options for readStack

    interface ReadStackOptions {
        apiUrl?: string;
        apiVersion?: string;
        env?: ProcessEnv | null;
        fetch?: {
            (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
            (input: string | URL | Request, init?: RequestInit): Promise<Response>;
        };
        loader?: BlueprintLoader;
        overrides?: Partial<BlueprintsApiConfig>
        | null;
        path?: string;
        token: string;
    }

    Hierarchy (View Summary)

    Index

    Properties

    apiUrl?: string

    The Sanity API origin. Defaults from SANITY_INTERNAL_ENV.

    apiVersion?: string

    The Blueprints API version. Defaults to SANITY_BLUEPRINTS_API_VERSION or DEFAULT_BLUEPRINTS_API_VERSION.

    env?: ProcessEnv | null

    The environment to read. Defaults to process.env. Pass null to skip environment variables.

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

    Defaults to the 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>

    Imports a JS or TS blueprint file in place of the built-in loading, for example to skip the module cache

    overrides?: Partial<BlueprintsApiConfig> | null

    Ids that win over every other source

    path?: string

    A blueprint file or directory. Defaults to the current working directory.

    token: string

    A Sanity auth token