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
subscribeTimeDate value describing when the user has joined the spacestring
receiversArray of users as receivers
  • type: (string) what type of receiver ('user' or 'anonymous')
  • _id: (string) unique identifier of receiver
  • username: (string) username (email) of receiver
  • displayname: (string) Name to display of receiver
  • picture_url: (string) URL to display picture of receiver
array of objects
senderInformation about the sender
  • _id: (string) User's id
  • displayname: (string) sender's name which is seen by the other space participants
  • phone_numbers: (array of objects)
    • verified: (boolean) defines whether the phone number is verified
    • primary: (boolean) defines whether the phone number is primary
    • canonicalForm: (string) phone number's standard form
    • type: (string) default is 'mobile'
    • value:(string) phone number value
  • picture_url: (string) a URL to user's profile image
  • type: (string) type of sender ('user' or 'anonymous')
  • username: (string) Sender's login name
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

Authorization

Subscribed to channel.

Example

socketConnection.emit('SEND_PRESENCE_EVENT', payload);

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

{
  "category":"app.event.presence.party.online",
  "content":{
     "offline":false,
     "idle":false,
     "mediaSession":{
        "audio":false,
        "video":false,
        "connected":false,
        "phone":false,
        "selfMuted":false,
        "screenshare":false
     },
     "desktop":false,
     "role":"admin",
     "subscribeTime":"2020-08-03T08:16:32.347Z"
  },
  "topicId":"59665be02c305405b327c2d1",
  "receivers":[],
  "sender":{
     "_id":"5f04251caa4a347af9946e04",
     "type":"user",
     "username":"test@user.com",
     "displayname":"Test User",
     "picture_url":"https://accounts.zang.io/norevimages/noimage.jpg",
     "phone_numbers":[]
  }
}

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

{
   "category":"app.event.presence.party.leaves",
   "content":{
      "offline":false,
      "idle":false,
      "mediaSession":{
         "audio":false,
         "video":false,
         "connected":false,
         "phone":false,
         "selfMuted":false,
         "screenshare":false,
         "joinTime":null
      },
      "desktop":false,
      "role":"admin"
   },
   "topicId":"59665be02c305405b327c2d1",
   "receivers":[],
   "sender":{
      "_id":"5f04251caa4a347af9946e04",
      "type":"user",
      "username":"test@user.com",
      "displayname":"Test User",
      "picture_url":"https://accounts.zang.io/norevimages/noimage.jpg",
      "phone_numbers":[]
   }
}