Construct a client object using an Ably ClientOptions object.
A ClientOptions object to configure the client connection to Ably.
Constructs a client object using an Ably API key or token string.
The Ably API key or token string used to validate the client.
An AuthCallbacks object.
A Channels object.
A PushCallbacks object.
Static
Callbacks
A callback based version of the library
Static
Crypto
The cryptographic functions available in the library.
Static
Message
Static utilities related to messages.
Static
PresenceStatic utilities related to presence messages.
Static
Promise
A promisified version of the library (use this if you prefer to use Promises or async/await instead of callbacks)
Retrieves the presence state for one or more channels, up to a maximum of 100 channels. Presence state includes the clientId
of members and their current PresenceAction.
An array of one or more channel names, up to a maximum of 100 channels.
A function which, upon success, will be called with a BatchResult object containing information about the result of the batch presence request for each requested channel. Upon failure, the function will be called with information about the error.
Publishes a BatchPublishSpec object to one or more channels, up to a maximum of 100 channels.
A BatchPublishSpec object.
A function which, upon success, will be called with a BatchResult object containing information about the result of the batch publish for each requested channel. Upon failure, the function will be called with information about the error.
Publishes one or more BatchPublishSpec objects to one or more channels, up to a maximum of 100 channels.
An array of BatchPublishSpec objects.
A function which, upon success, will be called with an array of BatchResult objects containing information about the result of the batch publish for each requested channel for each provided BatchPublishSpec. This array is in the same order as the provided BatchPublishSpec array. Upon failure, the function will be called with information about the error.
Makes a REST request to a provided path. This is provided as a convenience for developers who wish to use REST API functionality that is either not documented or is not yet included in the public API, without having to directly handle features such as authentication, paging, fallback hosts, MsgPack and JSON support.
The request method to use, such as GET
, POST
.
The request path.
Optional
params: any
The parameters to include in the URL query of the request. The parameters depend on the endpoint being queried. See the REST API reference for the available parameters of each endpoint.
Optional
body: any
The JSON body of the request.
Optional
headers: any
Additional HTTP headers to include in the request.
Optional
callback: StandardCallback<HttpPaginatedResponse<T>>
A function which, upon success, will be called with an HttpPaginatedResponse response object returned by the HTTP request. This response object will contain an empty or JSON-encodable object. Upon failure, the function will be called with information about the error.
Queries the REST /stats
API and retrieves your application's usage statistics. Returns a PaginatedResult object, containing an array of Stats objects. See the Stats docs.
Optional
params: any
A set of parameters which are used to specify which statistics should be retrieved. This parameter should be a StatsParams object. For reasons of backwards compatibility this parameter will also accept any
; this ability will be removed in the next major release of this SDK. If you do not provide this argument, then this method will use the default parameters described in the StatsParams interface.
Optional
callback: paginatedResultCallback<Stats>
A function which, upon success, will be called with a PaginatedResult object containing an array of Stats objects. Upon failure, the function will be called with information about the error.
Queries the REST /stats
API and retrieves your application's usage statistics, using the default parameters described in the StatsParams interface. Returns a PaginatedResult object, containing an array of Stats objects. See the Stats docs.
Optional
callback: paginatedResultCallback<Stats>
A function which, upon success, will be called with a PaginatedResult object containing an array of Stats objects. Upon failure, the function will be called with information about the error.
Retrieves the time from the Ably service as milliseconds since the Unix epoch. Clients that do not have access to a sufficiently well maintained time source and wish to issue Ably TokenRequest
s with a more accurate timestamp should use the queryTime property instead of this method.
Optional
callback: timeCallback
A function which, upon success, will be called with the time as milliseconds since the Unix epoch. Upon failure, the function will be called with information about the error.
Generated using TypeDoc
A client that offers a simple stateless API to interact directly with Ably's REST API.