Options
All
  • Public
  • Public/Protected
  • All
Menu

The options to set the config to

Hierarchy

  • ConfigOptions

Index

Properties

allowCacheByDefault?: boolean

Whether to allow requests to use the cache

This is overridden by RequestOptions.allowCache.
allowStackingByDefault?: boolean

Whether to allow request stacking in raw API calls

This is overridden by RawRequestOptions.allowStacking.
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

reuseJson?: boolean

Whether to reuse JSON objects returned by the fetchRaw() method instead of regenerating them every time they are drawn from cache;

Disabling this hurts performance, but hardens the code against bugs due to downstream code modifying API responses in the cache.
syncTime?: boolean

Whether to try and mitigate the difference between the timestamps returned by the API and the local system time. This affects the timestamps in the responses and cache control

If your system time is very accurate (1 second desync or less) you should disable this. Otherwise you should keep it enabled.
throwOnRatelimitError?: boolean

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

Generated using TypeDoc