Channel Rules and Namespaces
One or more channel rules may be configured for an app in your dashboard. These are rules which apply to a channel based on its ‘namespace’. The namespace is the first colon-delimited segment of its name (from the start, up to and including, the last character before the
:). If the channel name contains no colon, the namespace is the entire channel name.
For example, the following channels are all part of the “public” namespace:
The namespace attributes that can be configured are:
- Persist all messages – if enabled, all messages within this namespace will be stored according to the storage rules for your account (24 hours for free accounts). You can access stored messages via the history API . Please note that for each message stored, an additional message is deducted from your monthly allocation.
- State persistence – if enabled, the very last message published on a channel will be stored for an entire year, retrievable using the channel rewind mechanism by attaching to the channel with rewind=1. Only messages are stored, not presence messages. This last message storage is not accessible using the normal history API, only through rewind.
- Identified – if enabled, clients will not be permitted to use (including to attach, publish, or subscribe) matching channels unless they are identified (they have an assigned client ID). Anonymous clients are not permitted to join these channels. Find out more about authenticated and identified clients
- TLS only – if enabled, only clients who have connected to Ably over TLS will be allowed to use matching channels. Find out more
- Push notifications enabled – If checked, publishing messages with a push payload in the extras field is permitted and can trigger the delivery of a push notification to registered devices for the channel. Find out more.
Key or token capabilities can also specify access rights based on channel namespace. Find out more about authentication.