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}
| Parameter | Description |
|---|---|
idType: string | Unique identifier for the channel group. |
Methods
Available methods:
Regular methods
addChannelIdentifiers()addChannels()listChannels()removeChannelIdentifiers()removeChannels()whoIsPresent()
Event listeners
onMessageReceived()onPresenceChanged()(deprecated)connect()(deprecated)streamPresence()
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