A token string takes two forms:

  • A literal token
    This is the most common type of token generated by Ably.  It contains a complete encrypted set of information for the token such as the client identifier and capabilities.  The maximum length for a literal token string is 343 bytes.
  • A persisted token 
    If a token is explicitly requested to be persisted, or the Ably system determines it should be persisted due to the complexity of capabilities for example. The maximum length for a persisted token string is 65 bytes.

Please note that we do not recommend, as part of your strategy, that a token is stored in a database.  A token is meant to be disposable and easy to be regenerated from a token request.  As such, we recommend if a token is needed, you generate a new token request each time instead.