getAllowedChannels

View as Markdown
  • getAllowedChannels(): Promise<Object>

Returns the channels that the current token allows you to subscribe to.

Returns

Promise<Object>

An object whose keys are the channel names, and whose values are the permissions. For example:

1{
2 "my-channel-1": { "read": true, "write": false },
3 "my-channel-2": { "read": true, "write": true },
4}

Examples

1const chatClient = new Chat.Client({
2 token: "<your chat token>",
3});
4
5const channels = await chatClient.getAllowedChannels();
6console.log(channels);