Interface ConfigOptions

The options to set the config to

interface ConfigOptions {
    allowCacheByDefault?: boolean;
    apiKeys?: ApiKey[];
    defaultCacheTimes?: CacheTimeOptions;
    defaultRetries?: number;
    defaultTimeout?: number;
    maxQueueLength?: number;
    throwOnRatelimitError?: boolean;
}

Properties

allowCacheByDefault?: boolean

Whether to allow requests to use the cache or currently ongoing requests.

This is overridden by RequestOptions.allowCache.
apiKeys?: ApiKey[]

The API keys to use

defaultCacheTimes?: CacheTimeOptions

The amount of milliseconds to cache requests of these routes for

defaultRetries?: number

The amount of times a request should be retried on error

This is overridden by RequestOptions.retries.
defaultTimeout?: number

The amount of milliseconds a until a request should be rejected

This is overridden by RequestOptions.timeout.
Be aware that each retry has it's own timeout, meaning 30,000 ms of timeout may lead to a 90,000 ms wait until a request is rejected on 2 retries.
maxQueueLength?: number

How many request should be allowed to be queued before the wrapper rejects new requests with an error

throwOnRatelimitError?: boolean

Whether exceeding the ratelimit should throw an error, or whether the request should be retried after the ratelimit reset

Generated using TypeDoc