SDK
SDK Javascript v5.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.

logout #

Logs the user out.

This method is non-queuable, meaning that during offline mode, it will be discarded and the callback will be called with an error.

logout([callback]) #

ArgumentsTypeDescription
callbackfunctionOptional callback handling the response

This method empties the jwtToken property


Return value #

Returns the Kuzzle SDK object to allow chaining.


Callback Response #

Returns the Kuzzle SDK object once the logout process is complete, either successfully or not.
The Kuzzle SDK object will unset the jwtToken property if the user is successfully logged out.

Usage #

// Using callbacks (NodeJS or Web Browser)
kuzzle.logout(function (err, res) {
  // ...
});
// Using promises (NodeJS only)
kuzzle.logoutPromise()
  .then(res => {
    // ...
  });