The Kuzzle class is the main class of the SDK. Once instantiated, it represents a connection to your Kuzzle server.
It gives access to the different features of the SDKs:
- access to the available controllers
- SDK events handling
- resilience to connection loss
- network request queue management
You must include the following namespace:
| || |
|Authentication token used for API requests||yes|
| || |
|Queue requests when network is down and automatically replay them when the SDK successfully reconnects||yes|
| || |
|KuzzleEventHandler instance used for event management||no|
string| SDK instance unique identifier (send in the
Volatiledata) | no | |
-1) | Maximum amount of elements that the queue can contains (If set to -1, the size is unlimited) | yes | |
1000) | Maximum delay between two requests to be replayed | yes | |
3600000) | Minimum duration of a Token before being automaticaly refreshed (If set to -1 the SDK does not refresh the token automaticaly) | yes | |
null) | Function to filter the request queue before replaying requests. | yes | |
3600000) | Minimum duration of a Token after refresh (If set to -1 the SDK does not refresh the token automaticaly) | yes | |
string| SDK name with version number | no |
Each instance of the class communicates with the Kuzzle server through a class representing a network protocol implementation.
The following protocols are available in the SDK:
You can tell the Kuzzle SDK to attach a set of "volatile" data to each request. You can set it as an object contained in the
Volatile property of the Kuzzle object. The response to a request containing volatile data will contain the same data in its
Volatile property. This can be useful, for example, in real-time notifications for user join/leave notifications to provide additional informations about the client who sent the request.
Note that you can also set volatile data on a per-request basis (on requests that accept a
Volatile field in their
options argument). In this case, per-request volatile data will be merged with the global
Volatile object set in the constructor. Per-request fields will override global ones.