Get channel details

Fetch details of a specific channel using the getChannel() method.

Requires App Context

To store data about channels, you must enable App Context for your app's keyset in the Admin Portal.

Method signature

icon

Under the hood


This method takes the following parameters:

chat.getChannel(
id: string
): Promise<Channel | null>

Input

ParameterTypeRequiredDefaultDescription
idstringYesn/aUnique channel identifier (up to 92 UTF-8 byte sequences).

Output

TypeDescription
Promise<Channel> or Promise<null>Object returning either the new channel metadata or null value if the channel doesn't exist.

Errors

If you try to fetch a channel without providing its ID, you will receive the ID is required error.

Basic usage

Fetch the support channel metadata.

// reference the "chat" object and invoke the "getChannel()" method
const channel = await chat.getChannel("support")
Last updated on