Slack Developer Kit for Node.js
Go to GitHub

BaseAPIClient

Kind: global class

new BaseAPIClient(token, opts)

Base client for both the RTM and web APIs.

Param Type Description
token string The Slack API token to use with this client.
opts Object  
opts.slackAPIUrl String The Slack API URL.
opts.transport function Function to call to make an HTTP call to the Slack API.
[opts.logLevel] string The log level for the logger.
[opts.logger] function Function to use for log calls, takes (logLevel, logString) params.
opts.maxRequestConcurrency Number The max # of concurrent requests to make to Slack’s API’s, defaults to 3.
opts.retryConfig Object The configuration to use for the retry operation, {@see https://github.com/SEAPUNK/node-retry}

baseAPIClient.slackAPIUrl : string

Kind: instance property of [BaseAPIClient](#BaseAPIClient)

baseAPIClient.transport : function

Kind: instance property of [BaseAPIClient](#BaseAPIClient)

baseAPIClient.retryConfig

Default to retrying forever with an exponential backoff, capped at thirty minutes but with some randomization.

Kind: instance property of [BaseAPIClient](#BaseAPIClient)

baseAPIClient.logger : function

The logger function attached to this client.

Kind: instance property of [BaseAPIClient](#BaseAPIClient)

baseAPIClient._createFacets()

Initializes each of the API facets.

Kind: instance method of [BaseAPIClient](#BaseAPIClient)
Access: protected

baseAPIClient.registerDataStore(dataStore)

Attaches a data-store to the client instance.

Kind: instance method of [BaseAPIClient](#BaseAPIClient)

Param Type
dataStore [SlackDataStore](#SlackDataStore)

baseAPIClient._callTransport(task, queueCb)

Calls the supplied transport function and processes the results.

This will also manage 429 responses and retry failed operations.

Kind: instance method of [BaseAPIClient](#BaseAPIClient)
Access: protected

Param Type Description
task object The arguments to pass to the transport.
queueCb function Callback to signal to the request queue that the request has completed.