Emit this socket event to inform the space of a change in the user's presence state.

Payload Parameters

NameDescriptionJSON type
categoryType of presence event to send. See categories below.string
contentCurrent presence state.
  • desktop: (boolean) Not used.
  • idle: (boolean) is the user inactive
  • mediaSession: (object) media session state
    • audio: (boolean) is the user sending audio
    • connected: (boolean) is the user connected to the media session
    • screenshare: (boolean) is the user sharing their screen
    • selfMuted: (boolean) is the user muted
    • video: (boolean) is the user sending video
  • offline: (boolean) is the user disconnected
  • role: (string) user's role in the space ('admin', 'member', 'guest')
Object
topicIdUnique identifier of the space.string
loopbackMetadataOptional. This field will be passed back unchanged from server in PRESENCE_EVENT_RESPONSE. This property is only sent to the socket connection that created it.Any

Presence Event Categories

NameDescription
app.event.presence.party.leavesA party (sender) has left the space
app.event.presence.party.onlineA party (sender) has joined the space
app.event.presence.request.partiesRequest all parties send a SEND_PRESENCE_EVENT with category 'app.event.presence.party.online'. When joining a space send a socket event with this category to get the presence of the other parties.

Authorization

Subscribed to channel.

Example

socketConnection.emit('SEND_PRESENCE_EVENT', payload);

Payload

{
  "category": "app.event.presence.party.online",
  "content": {
      "desktop": false,
      "idle": false,
      "mediaSession": {
        "audio": false,
        "connected": false,
        "phone": false,
        "screenshare": false,
        "selfMuted": true,
        "video": false
      },
      "offline": false,
      "role": "admin"
  },
  "topicId": "594140a11d108619100a7369",
  "loopbackMetadata": "some metadata"
}

Payload ('app.event.presence.party.leaves')

{
  "topicId":"59665be02c305405b327c2d1",
  "category":"app.event.presence.party.leaves"
}