roleChanged

Emitted when a role of a user changes. This can be useful if you have a custom participants panel and want to display up-to-date roles or you just want to react to a role change.

Sample payload

{
  "type": "roleChanged",
  "data": {
      "userId": "2775f882-845e-4416-82c9-04cc25669c0b",
      "from": "attendee",
      "to": "moderator"
    }
  }
}

Sample subscription code

sambaFrame.on('roleChanged', (event) => {
  const data = event.data;
  console.log('User', data.userId, 'role changed from', data.from, 'to', data.to);
});

This event is often used with the changeRole method.

Last updated