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
This method takes the following parameters:
chat.getChannel(
id: string
): Promise<Channel | null>
Input
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
id | string | Yes | n/a | Unique channel identifier (up to 92 UTF-8 byte sequences). |
Output
Type | Description |
---|---|
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")