@shopify/cli-kit
    Preparing search index...

    Interface TokenProvider

    Pluggable strategy for obtaining and refreshing the Admin API access token that the GraphiQL proxy injects into every request.

    • getToken may return a cached token; the proxy calls it for every request.
    • refreshToken (optional) is invoked when the upstream Admin API returns 401. When omitted, the proxy falls back to calling getToken again on 401.
    • Both operations receive a cancellation signal to pass to token requests.

    Implementations must throw TokenRefreshError (or any thrown error) when the token cannot be obtained; the proxy renders the unauthorized template in that case.

    interface TokenProvider {
        getToken: (signal?: AbortSignal) => Promise<string>;
        refreshToken?: (signal?: AbortSignal) => Promise<string>;
    }
    Index
    getToken: (signal?: AbortSignal) => Promise<string>
    refreshToken?: (signal?: AbortSignal) => Promise<string>