ChannelGroup object
ChannelGroup represents a collection of channels that can be subscribed to as a single unit. Subscribe to multiple channels with one call instead of managing individual subscriptions.
Publishing to a channel group is not supported - publish to each channel individually.
Requires Stream Controller add-on
Enable the Stream Controller add-on for your key in the Admin Portal. Refer to the support page for details.
Properties
ChannelGroup has the following properties:
1class ChannelGroup {
2 id: string,
3 chat: Chat
4}
| Parameter | Description |
|---|---|
idType: string | Unique identifier for the channel group. |
chatType: Chat | Reference to the main Chat object. |
Methods
Available methods:
addChannelIdentifiers()addChannels()connect()listChannels()removeChannelIdentifiers()removeChannels()streamPresence()whoIsPresent()
Use case
ChannelGroup methods enable:
- Subscribing to messages from multiple channels at once
- Monitoring presence across all channels in the group
- Dynamically adding or removing channels as users join or leave conversations
- Simplified message handling for multi-chat apps