What are Channel Mode Flags and how do I use them?

Channel mode flags are a channelOption which allow a client to specify a subset of the permissions given in your token/key. This can be especially helpful when you want to avoid unnecessary presence subscriptions and can result in a significant number of messages being saved. 

 

A simple JavaScript example would be:

var channelOpts = {modes: ['PRESENCE','SUBSCRIBE','PUBLISH']};

 

The available Channel Mode Flags are:

'PRESENCE' , 'PUBLISH' , 'SUBSCRIBE', 'PRESENCE_SUBSCRIBE'

 

You can read the channelOptions section of our docs for more context on this.

 

As this is server side filtering, it can be used to save unnecessary messages counting towards your usage such as preventing presence updates going to all users.

 

Note: As these are flags and not permissions, these cannot be enforced by an auth server. 

It is also important to note that, as of the time of writing, not all SDKs have channel mode flags but we are working towards implementing this. Do let us know if it is missing from your desired SDK.

 

If you need any further assistance then please visit our support portal. We'll be happy to help!