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 Default Description
token string   The Slack API token to use with this client.
[opts] Object    
[opts.slackAPIUrl] string "https://slack.com/api/" The Slack API URL.
[opts.transport] BaseAPIClient~transportFn   Function to call to make an HTTP call to the Slack API.
[opts.logLevel] string "info" The log level for the logger.
[opts.logger] BaseAPIClient~logFn   Function to use for log calls, takes (logLevel, logString) params.
[opts.maxRequestConcurrency] number 3 The max # of concurrent requests to make to Slack’s API
[opts.retryConfig] Object   The configuration to use for the retry operation, see node-retry for more details.

baseAPIClient.slackAPIUrl : string

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

baseAPIClient.logger : BaseAPIClient~logFn

The logger function attached to this client.

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

baseAPIClient.transport : BaseAPIClient~transportFn

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

baseAPIClient.retryConfig : Object

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

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)

Deprecated

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.