# listUsers()

Returns an array of the current users inside the room.

<pre class="language-javascript"><code class="lang-javascript">let users = sambaFrame.listUsers();
console.log('There are', users.length, 'users inside the room:');
console.log(users);

/*Here is how the array looks like:
<strong>[
</strong>    {
        "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"
    }
]*/
</code></pre>

**Sample use case**: \
You want to have a list of the current users participating in the room.

{% hint style="info" %}
Look at the [usersUpdated](/reference/sdk/events/usersupdated.md) event if you want to subscribe to an always up-to-date array of the users inside the room.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.digitalsamba.com/reference/sdk/methods/listusers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
