This reference assumes you have already set up the Hop server-side
SDK.
Reference
Channel Stats
We provide functionality to get statistics about certain channels, such as how many users are currently connected to them.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
We provide functionality to get statistics about certain channels, such as how many users are currently connected to them.
type Stats = {
// How many clients are connected to this channel
online_count: number;
};
// Import your Hop SDK instance
import { hop } from ".";
const channelId = "channel_xxx"; // the channel we want to get statistics for
const stats = await hop.channels.getStats(channelId);
/*
* - stats = {
* - "online_count": 0
* - }
*/