Presence
Customize Behavior
setInactivityTime
- Set the time it takes for a
User
to go inactive in milliseconds. - By default we mark a
User
as inactive if they do not take any action on the document within a 5 mins timeframe. - If they unfocus the tab, we mark them inactive immediately.
Default: 300000ms (5 min)
Using API:
location
- Show
Presence
on aLocation
. - Set the
location
attribute on thePresence
element. When there areUsers
at that location, their avatars will show in thisPresence
element. - Eg: For a Presentation tool, you can add
Presence
component at the maindocument
level and add anotherPresence
component on the slide thumbnails. This will render avatars at both presentation level & slide thumbnail level. For slide thumbnails, it will only showUsers
active on that slide.
maxUsers
- Set how many
Presence
avatars to display at a time. - You can set this via the
maxUsers
attribute. Any extra avatars will be hidden and shown in an avatar which indicates the number of extraUsers
.
onPresenceUserChange
- Whenever the
Presence
for anyUser
changes, we emit this event with the updated list ofUsers
currently online on this document.
self
- Whether to include yourself in the list of
Presence
users. - Default:
true
API Method:
onPresenceUserClick
- To handle click events on
Presence
avatar circles, pass an event handler to theonPresenceUserClick
event.
getOnlineUsersOnCurrentDocument
- Subscribe to a list of all online users who are either active or inactive on the current document.