User Presence
Confused about "User Presence"?
Let us know how we can improve our documentation:
- On This Page:
- Invisible
- Listening to Presence Changes
User presence allows you to show when a user was last active and if they are online right now. Whenever you read a user the data will look like this:
Invisible
Copied!Confused about "Invisible"?
Let us know how we can improve our documentation:
To mark your user as invisible, you can update your user to set the invisible property to true. Your user will remain invisible even if you disconnect and reconnect. You must explicitly set invisible to false in order to become visible again.
You can also set your user to invisible when connecting by setting the invisible property to true. You can also set a custom status message at the same time:
Listening to Presence Changes
Copied!Confused about "Listening to Presence Changes"?
Let us know how we can improve our documentation:
Of course, you want to listen to the user presence changes. This allows you to show a user as offline when they leave and update their status in real time. These 3 endpoints allow you to watch user presence:
A users online status change can be handled via event delegation by subscribing to the user.presence.changed
event the same you do for any other event.