Contains the properties of a request for a token to Ably. Tokens are generated using requestToken or requestToken.

Hierarchy

  • TokenRequest

Properties

capability: string

Capability of the requested Ably Token. If the Ably TokenRequest is successful, the capability of the returned Ably Token will be the intersection of this capability with the capability of the issuing key. The capabilities value is a JSON-encoded representation of the resource paths and associated operations. Read more about capabilities in the capabilities docs.

clientId?: string

The client ID to associate with the requested Ably Token. When provided, the Ably Token may only be used to perform operations on behalf of that client ID.

keyName: string

The name of the key against which this request is made. The key name is public, whereas the key secret is private.

mac: string

The Message Authentication Code for this request.

nonce: string

A cryptographically secure random string of at least 16 characters, used to ensure the TokenRequest cannot be reused.

timestamp: number

The timestamp of this request as milliseconds since the Unix epoch.

ttl?: number

Requested time to live for the Ably Token in milliseconds. If the Ably TokenRequest is successful, the TTL of the returned Ably Token is less than or equal to this value, depending on application settings and the attributes of the issuing key. The default is 60 minutes.

Default Value

60min

Generated using TypeDoc