> For the complete documentation index, see [llms.txt](https://docs.digitalsamba.com/reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digitalsamba.com/reference/sdk/events/usersupdated.md).

# usersUpdated

When the users list inside the room changes then the **usersUpdated** event will be emitted.

#### Sample payload

```json
{
  "type": "usersUpdated",
  "data": {
    "users": [
        {
            "id": "08c82f56-c670-4d36-bfe3-87a8cd0f7f29",
            "name": "John",
            "avatarColor": "#90c695",
            "role": "moderator",
            "kind": "local"
        },
        {
            "id": "15a0b10d-5f0f-47a9-9889-1d92651aa6d8",
            "name": "Lucas",
            "avatarColor": "#3498db",
            "role": "moderator",
            "deviceType": "desktop",
            "kind": "remote"
        }
    ]
  }
}
```

#### Sample subscription code

```javascript
sambaFrame.on('usersUpdated', (event) => {
  const data = event.data;
  console.log('Current users inside the room', data.users);
});
```
