ordercloud-javascript-sdk
    Preparing search index...

    Interface SdkConfiguration

    interface SdkConfiguration {
        apiVersion?: string;
        baseApiUrl?: string;
        clientID?: string;
        cookieOptions?: CookieOptions;
        fetch?: (input: string, init?: RequestInit) => Promise<Response>;
        onRequest?: (
            request: SdkHttpRequest,
        ) => SdkHttpRequest | Promise<SdkHttpRequest>;
        onResponse?: (
            response: SdkHttpResponse,
        ) => SdkHttpResponse | Promise<SdkHttpResponse>;
        timeoutInMilliseconds?: number;
    }
    Index
    apiVersion?: string

    At the time of writing there is only one version of the API

    Defaults to: v1

    baseApiUrl?: string

    The apiurl that will be used to talk to the ordercloud API. It may be useful to change this to interact with different environments This URL can be found on your dashboard or in the upper right hand context menu of your OrderCloud application in Sitecore Portal.

    Defaults to: https://api.ordercloud.io

    clientID?: string

    when set is used to call the refresh token endpoint to obtain a new access token when exired (provided a refresh token is set in the sdk) this functionality is only intended for users that interact with at most one client per sdk instance

    cookieOptions?: CookieOptions
    fetch?: (input: string, init?: RequestInit) => Promise<Response>

    Optional fetch implementation. Defaults to the platform global fetch. Use this to mock, cache, or reroute HTTP.

    onRequest?: (
        request: SdkHttpRequest,
    ) => SdkHttpRequest | Promise<SdkHttpRequest>

    Runs before a request is sent. Return the request that should be sent.

    onResponse?: (
        response: SdkHttpResponse,
    ) => SdkHttpResponse | Promise<SdkHttpResponse>

    Runs after a response is received and before the SDK returns data or throws.

    timeoutInMilliseconds?: number

    specifies the number of milliseconds before the request times out. If the request takes longer than timeoutInMilliseconds, the request will be aborted. Default timeout is 60,000 milliseconds or 60 seconds