Skip to main content
Presence enables clients to be aware of other clients that are currently present on a channel. Each member present on a channel has a unique self-assigned client identifier and system-assigned connection identifier, along with an optional payload that can be used to describe the member’s status or attributes. Presence enables you to quickly build apps such as chat rooms and multiplayer games by automatically keeping track of who is present in realtime across any device.

Enter the presence set

To enter the presence set of a channel, use the enter() method:

Subscribe to presence events

Subscribe to presence events to be notified when members enter, leave, or update their status:

Subscribe to specific presence events

You can subscribe to specific presence event types:

Presence events

The following presence events are emitted:
EventDescription
enterA new member has entered the channel
leaveA member who was present has now left the channel
updateAn already present member has updated their member data
presentWhen subscribing to presence events on a channel that already has members present, this event is emitted for every member already present on the channel

Update presence data

Members can update their presence data at any time:

Leave the presence set

To explicitly leave the presence set:

Get the current presence set

Retrieve the current members of the presence set:

Presence with multiple devices

A single clientId can be present multiple times on the same channel via different connections. For example, if a user is connected on both mobile and desktop:

Presence history

You can retrieve historical presence events:

Best practices

Keep presence data small

Presence data is transmitted to all subscribers, so keep it minimal:

Use presence.get() efficiently

Instead of maintaining your own list of members, call presence.get() when needed:

Next steps

Build docs developers (and LLMs) love