ChannelDetails

Channel metadata describes the current state of a channel, including whether it is active and its occupancy metrics. It is represented by the ChannelDetails type, which a Channel returns from its status() method.

JavaScript

1

2

3

const channel = rest.channels.get('all-gas-ion');
const details = await channel.status();
console.log(details.channelId, details.status.occupancy.metrics.connections);

ChannelDetails

A ChannelDetails object contains information about a channel, along with its current state in a ChannelStatus object.

channelIdString
The name of the channel, including any qualifier.
statusChannelStatus
The current state of the channel.

Example

The following is an example of a ChannelDetails payload:

JSON

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

{
  "channelId": "foo",
  "status": {
    "isActive": true,
    "occupancy": {
      "metrics": {
        "connections": 1,
        "publishers": 1,
        "subscribers": 1,
        "presenceConnections": 1,
        "presenceMembers": 0,
        "presenceSubscribers": 1
      }
    }
  }
}