A client ID, used for identifying this client when publishing messages or for presence purposes. The clientId
can be any non-empty string, except it cannot contain a *
. This option is primarily intended to be used in situations where the library is instantiated with a key. Note that a clientId
may also be implicit in a token used to instantiate the library. An error is raised if a clientId
specified here conflicts with the clientId
implicit in the token. Find out more about identified clients.
Instructs the library to get a new token immediately. When using the realtime client, it upgrades the current realtime connection to use the new token, or if not connected, initiates a connection to Ably, once the new token has been obtained. Also stores any TokenParams and AuthOptions passed in as the new defaults, to be used for all subsequent implicit or explicit token requests. Any TokenParams and AuthOptions objects passed in entirely replace, as opposed to being merged with, the current client library saved values.
Optional
tokenParams: TokenParams
A TokenParams object.
Optional
authOptions: AuthOptions
An AuthOptions object.
Optional
callback: tokenDetailsCallback
A function which, upon success, will be called with a TokenDetails object. Upon failure, the function will be called with information about the error.
Instructs the library to get a new token immediately. When using the realtime client, it upgrades the current realtime connection to use the new token, or if not connected, initiates a connection to Ably, once the new token has been obtained. Also stores any TokenParams passed in as the new default, to be used for all subsequent implicit or explicit token requests. Any TokenParams object passed in entirely replaces, as opposed to being merged with, the current client library saved value.
Optional
tokenParams: TokenParams
A TokenParams object.
Optional
callback: tokenDetailsCallback
A function which, upon success, will be called with a TokenDetails object. Upon failure, the function will be called with information about the error.
Instructs the library to get a new token immediately. When using the realtime client, it upgrades the current realtime connection to use the new token, or if not connected, initiates a connection to Ably, once the new token has been obtained.
Optional
callback: tokenDetailsCallback
A function which, upon success, will be called with a TokenDetails object. Upon failure, the function will be called with information about the error.
Creates and signs an Ably TokenRequest based on the specified (or if none specified, the client library stored) TokenParams and AuthOptions. Note this can only be used when the API key
value is available locally. Otherwise, the Ably TokenRequest must be obtained from the key owner. Use this to generate an Ably TokenRequest in order to implement an Ably Token request callback for use by other clients. Both TokenParams and AuthOptions are optional. When omitted or null
, the default token parameters and authentication options for the client library are used, as specified in the ClientOptions when the client library was instantiated, or later updated with an explicit authorize
request. Values passed in are used instead of, rather than being merged with, the default values. To understand why an Ably TokenRequest may be issued to clients in favor of a token, see Token Authentication explained.
Optional
tokenParams: null | TokenParams
A TokenParams object.
Optional
authOptions: null | AuthOptions
An AuthOptions object.
Optional
callback: tokenRequestCallback
A function which, upon success, will be called with a TokenRequest object. Upon failure, the function will be called with information about the error.
Creates and signs an Ably TokenRequest based on the specified (or if none specified, the client library stored) TokenParams. Note this can only be used when the API key
value is available locally. Otherwise, the Ably TokenParams must be obtained from the key owner. Use this to generate an Ably TokenRequest in order to implement an Ably Token request callback for use by other clients. When the TokenRequest is omitted or null
, the default token parameters for the client library are used, as specified in the ClientOptions when the client library was instantiated, or later updated with an explicit authorize
request. Values passed in are used instead of, rather than being merged with, the default values. To understand why an Ably TokenRequest may be issued to clients in favor of a token, see Token Authentication explained.
Optional
tokenParams: null | TokenParams
A TokenParams object.
Optional
callback: tokenRequestCallback
A function which, upon success, will be called with a TokenRequest object. Upon failure, the function will be called with information about the error.
Creates and signs an Ably TokenRequest based on the the client library stored TokenParams and AuthOptions. Note this can only be used when the API key
value is available locally. Otherwise, the Ably TokenRequest must be obtained from the key owner. Use this to generate an Ably TokenRequest in order to implement an Ably Token request callback for use by other clients. The default token parameters and authentication options for the client library are used, as specified in the ClientOptions when the client library was instantiated, or later updated with an explicit authorize
request. To understand why an Ably TokenRequest may be issued to clients in favor of a token, see Token Authentication explained.
Optional
callback: tokenRequestCallback
A function which, upon success, will be called with a TokenRequest object. Upon failure, the function will be called with information about the error.
Calls the requestToken
REST API endpoint to obtain an Ably Token according to the specified TokenParams and AuthOptions. Both TokenParams and AuthOptions are optional. When omitted or null
, the default token parameters and authentication options for the client library are used, as specified in the ClientOptions when the client library was instantiated, or later updated with an explicit authorize
request. Values passed in are used instead of, rather than being merged with, the default values. To understand why an Ably TokenRequest may be issued to clients in favor of a token, see Token Authentication explained.
Optional
TokenParams: null | TokenParams
A TokenParams object.
Optional
authOptions: null | AuthOptions
An AuthOptions object.
Optional
callback: tokenDetailsCallback
A function which, upon success, will be called with a TokenDetails object. Upon failure, the function will be called with information about the error.
Calls the requestToken
REST API endpoint to obtain an Ably Token according to the specified TokenParams. When omitted or null
, the default token parameters and authentication options for the client library are used, as specified in the ClientOptions when the client library was instantiated, or later updated with an explicit authorize
request. Values passed in are used instead of, rather than being merged with, the default values. To understand why an Ably TokenRequest may be issued to clients in favor of a token, see Token Authentication explained.
Optional
TokenParams: null | TokenParams
A TokenParams object.
Optional
callback: tokenDetailsCallback
A function which, upon success, will be called with a TokenDetails object. Upon failure, the function will be called with information about the error.
Calls the requestToken
REST API endpoint to obtain an Ably Token. The default token parameters and authentication options for the client library are used, as specified in the ClientOptions when the client library was instantiated, or later updated with an explicit authorize
request. To understand why an Ably TokenRequest may be issued to clients in favor of a token, see Token Authentication explained.
Optional
callback: tokenDetailsCallback
A function which, upon success, will be called with a TokenDetails object. Upon failure, the function will be called with information about the error.
Revokes the tokens specified by the provided array of TokenRevocationTargetSpecifiers. Only tokens issued by an API key that had revocable tokens enabled before the token was issued can be revoked. See the token revocation docs for more information.
An array of TokenRevocationTargetSpecifier objects.
Optional
options: TokenRevocationOptions
A set of options which are used to modify the revocation request.
Optional
callback: StandardCallback<BatchResult<TokenRevocationSuccessResult | TokenRevocationFailureResult>>
A function which, upon success, will be called with a BatchResult containing information about the result of the token revocation request for each provided [TokenRevocationTargetSpecifier
]TokenRevocationTargetSpecifier. Upon failure, the function will be called with information about the error.
Generated using TypeDoc
Creates Ably TokenRequest objects and obtains Ably Tokens from Ably to subsequently issue to less trusted clients.