SDK
SDK Javascript v6.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

disconnect #

Closes the current connection to Kuzzle. The SDK then enters the offline state. A call to disconnect() will not trigger a disconnected event. This event is only triggered on unexpected disconnection.

If there are still pending requests during the disconnect call, a discarded event will be issued for each of them.

Arguments #

disconnect();

Usage #

try {
  kuzzle.disconnect();
  console.log('Successfully disconnected');
} catch (error) {
  console.error(error);
}