getAllowedChannels

View as MarkdownOpen in Claude
  • 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:

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

Examples

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