interface SpotifyConfig {
    acccessToken?: string;
    accessToken?: string;
    clientCredentials?: {
        clientId?: string;
        clientSecret?: string;
    };
    debug?: boolean;
    http?: {
        baseURL?: string;
        headers?: Record<string, string>;
        localAddress?: string;
        proxy?: AxiosProxyConfig;
        userAgent?: string;
    };
    logRetry?: boolean;
    refreshToken?: string;
    retry?: boolean;
    retry5xx?: boolean;
    retry5xxAmount?: number;
}

Properties

acccessToken?: string

Renamed to accessToken because of a typo. Will be removed in the next major version.

accessToken?: string
clientCredentials?: {
    clientId?: string;
    clientSecret?: string;
}
debug?: boolean

Enable debug mode.

http?: {
    baseURL?: string;
    headers?: Record<string, string>;
    localAddress?: string;
    proxy?: AxiosProxyConfig;
    userAgent?: string;
}

HTTP options.

Type declaration

  • OptionalbaseURL?: string

    Base URL for the API. Default: "https://api.spotify.com".

  • Optionalheaders?: Record<string, string>

    Set headers to be sent with every request.

  • OptionallocalAddress?: string

    Change the default outbind IP (can be IPV6 or IPV4).

  • Optionalproxy?: AxiosProxyConfig

    HTTP proxy config.

  • OptionaluserAgent?: string

    Set a custom user agent. Default: "spotify.js/ https://github.com/statsfm/spotify.js".

logRetry?: boolean

Log retries.

refreshToken?: string
retry?: boolean

Retry request when ratelimit is hit.

retry5xx?: boolean

Retry request if the response code is in the 500 range. Default: true

retry5xxAmount?: number

Amount of retries. Default: 3