On this page

Get channel details

Fetch a specific channel's metadata with getChannel().

Requires App Context

Enable App Context for your keyset in the Admin Portal.

Method signature

icon

Under the hood


This method takes the following parameters:

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

Input

* required
ParameterDescription
id *
Type: string
Default:
n/a
Unique 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.

Sample code

Fetch the support channel metadata.

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