Ably’s presence feature allows clients or devices to announce their presence on a channel. Other devices or services may then subscribe to these presence events (such as entering, updating their state, or leaving the channel) in real time using our realtime SDKs, or via the Ably Integrations. You can also request a list of clients or devices that are online/offline on a channel at a particular point in time via the REST API.
Furthermore, if persistence is enabled on the presence channel, you can also retrieve presence history for the channel, i.e, static data about historical presence states of your clients/devices. This operation also can be done using both Ably’s Realtime and REST libraries.
Occupancy and presence
The occupancy and presence features differ in the following ways:
- provides metrics about the clients attached to a channel. This includes a count of the number of clients attached, the number of publishers and subscribers, the number of presence members, and the number of presence publishers and subscribers.
- provides information about the activity of members entered into the presence set of a channel. Presence members announce their state to presence subscribers via presence events. For example, when entering the presence set, leaving the presence set, or updating their member data.