How can I implement presence subscriptions efficiently, in terms of limits?

If you want lots of people to be present, but without necessarily listening for presence change events, tokens can be used to prevent all users from receiving presence notifications while still allowing them to enter the presence set. This is a common scenario when you just want to know how many people are present on a channel at any point in time. An example of such a differential token capability is shown below:

 

{
"presenceChannel": ["publish", "presence"],
"chat": ["presence", "history", "subscribe"],
}

 

Learn more best practices of using Ably.