Interface IRettiwtConfig

The configuration for initializing a new Rettiwt instance.

interface IRettiwtConfig {
    apiKey?: string;
    delay?: number | () => number | Promise<number>;
    errorHandler?: IErrorHandler;
    headers?: { [key: string]: string };
    logging?: boolean;
    proxyUrl?: URL;
    tidProvider?: ITidProvider;
    timeout?: number;
}

Properties

apiKey?: string

The apiKey (cookie) to use for authenticating Rettiwt against Twitter API.

delay?: number | () => number | Promise<number>

The delay (in ms) to use between concurrent request.

Can either be a number or a function that returns a number synchronously or asynchronously.

errorHandler?: IErrorHandler

Optional custom error handler to define error conditions and process API/HTTP errors in responses.

headers?: { [key: string]: string }

Optional custom HTTP headers to add to all requests to Twitter API.

Custom headers can be useful for proxies, avoiding rate limits, etc.

logging?: boolean

Whether to write logs to console or not.

proxyUrl?: URL

Optional URL to proxy server to use for requests to Twitter API.

When deploying to cloud platforms, if setting IRettiwtConfig.authProxyUrl does not resolve Error 429, then this might be required.

tidProvider?: ITidProvider

Optional custom x-client-transaction-id header provider.

timeout?: number

The max wait time (in milli-seconds) for a response; if not set, Twitter server timeout is used.