getOnlineUsers();
Call this method to get a list of online users in the chat room. It returns a maximum of 150 users. If there are more than 150 users then the list will be truncted. It also contains onlineUsersCount
which can be used to determine the actual count of online users in the chat room.
JavaScript
const onlineUsers = await sdk.getOnlineUsers();
Response​
Properties | Description | Type |
---|---|---|
eventId | Internal Event ID | String |
onlineUsers | Array of Online Users | Array |
onlineUsersCount | Count of the actual number of online users | Number |
onlineUsers Property​
Properties | Description | Type |
---|---|---|
_id | id of the user | String |
username | username of the user | String |
email of the user | String |
Sample Response​
This returns a Array of Objects containing the Online Users.
JSON Sample response getOnlineUsers
{
"eventId": "d3598a94-8024-4330-aa2e-bc4159640c00",
"onlineUsers": [
{
"_id": "6334663bef8099f101b4683a",
"username": "mike"
},
{
"_id": "633465e6ef8099f101b4681e",
"username": "moderator",
},
{
"_id": "631656ccde22da0aa5ff49ef",
"username": "steve",
}
],
"onlineUsersCount": 3
}