This event is emitted by the server upon a change in user presence. Clients must listen for this event and update the presence status of other users in the room accordingly.

Payload Parameters

NameDescriptionJSON type
categoryType of presence event received. See categories below.string
topicIdUnique identifier of topic to send message to.string
sender
  • _id: unique identifier of the sender
  • username: the username of the sender
  • displayname: the display name of the sender
  • picture_url: URL linking to the profile picture of the user
  • type: what type of sender ('user', 'anonymous' or 'phone')
Object
contentCurrent presence state of sender.
  • 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')
  • sessionId: (string) SessionId for the socket connection. For reference only.
Object

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
media.session.invalidError processing SEND_PRESENCE_EVENT
app.event.presence.request.partiesA party is requesting the presence of all parties. Send a SEND_PRESENCE_EVENT with category 'app.event.presence.party.online'.

Authorization

Subscribed to channel.

Example

socketConnection.on('PRESENCE_EVENT_RESPONSE', callback(payload));

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

{
  "topicId": "56d0a0fb77a5fca01cb1767a",
  "sender": {
    "displayname": "John Smith",
    "picture_url": "https://storage.googleapis.com/onesnatesting/pictures/pfpic_johns_026498e4-e761-4acf-9a09-5b37ac7ed072",
    "type": "user",
    "username": "jsmith@fakeemail.com",
    "_id": "593989c06f0e166d93fab8a1"
  },
  "content": {
    "offline": false,
    "role": "admin",
    "mediaSession": {
        "video": true,
        "audio": true,
        "connected": true,
        "screenshare": true
    },
    "idle": false,
    "desktop": false,
    "sessionId": "310c8dd0-e3d4-42dc-de74-a71ca8404d29"
  },
  "category": "app.event.presence.party.online"
}

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

{
  "topicId":"59665be02c305405b327c2d1",
  "sender":{
      "displayname": "John Smith",
      "picture_url": "https://storage.googleapis.com/onesnatesting/pictures/pfpic_johns_026498e4-e761-4acf-9a09-5b37ac7ed072",
      "type": "user",
      "username": "jsmith@fakeemail.com",
      "_id": "593989c06f0e166d93fab8a1"
  },
  "content":{
      "sessionId":"67f4635f-72f3-4c98-aff4-374ac5dfe0e1"
  },
  "category":"app.event.presence.party.leaves"
}

Payload ('app.event.presence.request.parties')

{
  "category":"app.event.presence.request.parties",
  "content":{
      "sessionId":"c2ef2491-a25d-4a9f-9b42-13bc17bf5591"
  },
  "sender":{
    "displayname": "John Smith",
    "type": "user",
    "username": "jsmith@fakeemail.com",
    "_id": "593989c06f0e166d93fab8a1"
  },
  "topicId":"59665be02c305405b327c2d7"
}

Payload for dialin user ('app.event.presence.party.online')

{
  "_id": "00fa52ac-1904-46ea-b7dc-1c496a712aef",
  "category": "app.event.presence.party.online",
  "content": {
      "offline": false,
      "role": "guest",
      "mediaSession": {
          "video": false,
          "audio": true,
          "connected": true,
          "screenshare": false,
          "selfMuted": false,
          "phone": true
      },
      "idle": false,
      "desktop": false,
      "emitedby": "wcs",
      "sessionId": "CAe1889084a107d447398c45f7ab8f7aa2"
  },
  "sender": {
      "displayname": "John Smith",
      "_id": "CAe1889084a107d447398c45f7ab8f7aa2",
      "type": "phone",
      "username": "jsmith@fakeemail.com",
      "picture_url": "https://storage.googleapis.com/onesnatesting/pictures/pfpic_johns_026498e4-e761-4acf-9a09-5b37ac7ed072"
  },
  "topicId": "5a1339868509b80641a56655"
}

Payload for dialin user ('app.event.presence.party.leaves')

{
  "_id": "a5121c6d-33c4-4da7-841f-17a0225db85f",
  "category": "app.event.presence.party.leaves",
  "content": {
      "offline": false,
      "role": "guest",
      "mediaSession": {
          "video": false,
          "audio": true,
          "connected": false,
          "screenshare": false,
          "selfMuted": false,
          "phone": false
      },
      "idle": false,
      "desktop": false,
      "emitedby": "wcs",
      "sessionId": "CAe1889084a107d447398c45f7ab8f7aa2"
  },
  "sender": {
      "displayname": "John Smith",
      "_id": "CAe1889084a107d447398c45f7ab8f7aa2",
      "type": "phone",
      "username": "jsmith@fakeemail.com",
      "picture_url": "https://storage.googleapis.com/onesnatesting/pictures/pfpic_johns_026498e4-e761-4acf-9a09-5b37ac7ed072"
  },
  "topicId": "5a1339868509b80641a56655"
}