Get Live Count

Catalyst Data Streams allows you to track the number of active subscribers currently connected to a specific channel. This is useful for monitoring channel activity and implementing conditional logic based on subscriber presence.

The datastreams reference used in the code below is the component instance created earlier.

Track Active Subscribers

You can retrieve the live subscriber count by passing the channel ID to the getLiveCount() method. The promise returned here will be resolved to an object containing the count of active subscribers.

Parameters Used

Parameter Name Data Type Definition
channelId String A Mandatory parameter. Holds the unique ID of the channel.
copy
//Get the live subscriber count for a channel
const liveCount = await datastreams.getLiveCount(CRICKET_CHANNEL_ID);

Last Updated 2026-08-13 17:11:55 +0530 IST