Optional
rateOptional
defaultWaitTime?: numberOptional
getReset?: (res: Response) => MaybePromise<null | string | number>getter for the unix timestamp of the next reset can either be a unix timestamp in seconds or an ISO 8601 date string
Optional
isRejected?: (res: Response) => MaybePromise<boolean>check if the request was rejected due to rate limit
Optional
jitter?: numbernumber of milliseconds to add to the reset time when the rate limit is exceeded, to account for network latency and other factors
Optional
maxRetries?: numbermaximum number of retries
Optional
maxWaitTime?: numberwhen the rate limit has exceeded (i.e. isRejected
returns true),
what is the maximum acceptable time to wait until the rate limit is reset?
in milliseconds
Optional
onRateLimitExceeded?: (res: Response, waitTime: number) => voidfunction that will be called when the rate limit is exceeded (i.e. isRejected
returns true),
but before starting the wait timer
when the rate limit is exceeded (i.e.
isRejected
returns true), but the reset time is unknown (i.e.getReset
returnsnull
), what is the default time to wait until the rate limit is reset? in milliseconds