Skip to main content

Interface: RESTOptions

Options for a RESTManager

Hierarchy

Properties

rejectIfNotValid

Optional rejectIfNotValid: boolean

Set this false to use res.ok property.

Defined in

types/lib.ts:53


keys

Optional keys: string[]

Keys from Clash of Clans API developer site.

Inherited from

ClientOptions.keys

Defined in

types/lib.ts:14


baseURL

Optional baseURL: string

Base URL of the Clash of Clans API.

Inherited from

ClientOptions.baseURL

Defined in

types/lib.ts:17


retryLimit

Optional retryLimit: number

How many times to retry on 5XX errors.

Inherited from

ClientOptions.retryLimit

Defined in

types/lib.ts:22


cache

Optional cache: boolean | Store<any>

Whether enable or disable internal caching.

Example

const client = new Client({ cache: true });

Inherited from

ClientOptions.cache

Defined in

types/lib.ts:31


restRequestTimeout

Optional restRequestTimeout: number

Time to wait before cancelling a REST request, in milliseconds.

Inherited from

ClientOptions.restRequestTimeout

Defined in

types/lib.ts:34


throttler

Optional throttler: null | QueueThrottler | BatchThrottler

Throttler class which handles rate-limit

Example

const client = new Client({ throttler: new QueueThrottler(1000 / 10) });

Example

const client = new Client({ throttler: new BatchThrottler(30) });

Inherited from

ClientOptions.throttler

Defined in

types/lib.ts:47