In-App UI
JavaScript
SDK
SlackClient

SlackClient reference

Complete reference for the SlackClient in the Knock JavaScript SDK.

Client for interacting with Slack integration operations in the Knock API.

Constructor

#

Initializes a new Slack client instance.

Parameters:

instanceKnock
The Knock client instance to use for API requests.

Returns: SlackClient

Methods

#

authCheck

#

Checks the authentication status for a Slack channel integration.

Parameters:

tenantstring
The tenant identifier to check authentication for.
knockChannelIdstring
The Knock channel ID for the Slack integration.

Returns: Promise<ApiResponse>

Example:

getChannels

#

Retrieves available Slack channels for the authenticated integration.

Parameters:

knockChannelIdstring
The Knock channel ID for the Slack integration.
tenantstring
The tenant identifier.
queryOptionsSlackChannelQueryOptions
Optional query parameters for filtering and pagination.

Query Options:

cursorstring
Pagination cursor for retrieving the next set of results.
limitnumber
Maximum number of channels to return.
excludeArchivedboolean
Whether to exclude archived channels from the results.
teamIdstring
Slack team ID to filter channels by.
typesstring[]
Array of channel types to include (e.g., ['public_channel', 'private_channel']).

Returns: Promise<GetSlackChannelsResponse>

Example:

revokeAccessToken

#

Revokes the access token for a Slack integration, effectively disconnecting it.

Parameters:

tenantstring
The tenant identifier.
knockChannelIdstring
The Knock channel ID for the Slack integration to revoke access for.

Returns: Promise<ApiResponse>

Example: