> 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/roomstateupdated.md).

# roomStateUpdated

Emitted when the room state changes. The updated room state is included in the payload.

Read about the room state specification in the [roomState](/reference/sdk/properties/roomstate.md) property.

{% hint style="info" %}
You can also access the latest room state through the [roomState](/reference/sdk/properties/roomstate.md) property.
{% endhint %}

#### Sample payload

```json
{
  "type": "roomStateUpdated",
  "data": {
    //Look at the roomState property for full payload description
  }
}
```

#### Sample subscription code

```javascript
sambaFrame.on('roomStateUpdated', (event) => {
  const data = event.data;
  //Read some properties from the updated room state
  //data.layout.mode
});
```
