> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hop.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Channel Stats

> We provide functionality to get statistics about certain channels, such as how many users are currently connected to them.

<Info>
  This reference assumes you have already set up the [Hop server-side
  SDK](/sdks/server/js).
</Info>

## Get Stats

The following function will return the following type:

```ts theme={null}
type Stats = {
  // How many clients are connected to this channel
  online_count: number;
};
```

```js theme={null}
// 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
 * - }
 */
```
