Skip to main content

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

PropertiesDescriptionType
eventIdInternal Event IDString
onlineUsersArray of Online UsersArray
onlineUsersCountCount of the actual number of online usersNumber

onlineUsers Property

PropertiesDescriptionType
_idid of the userString
usernameusername of the userString
emailemail of the userString

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
}