getAllowedChannels

View as MarkdownOpen in Claude

getAllowedChannels

  • 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 },
}

Example

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