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.

logout #

Revokes the current authentication token.

If there were any, real-time subscriptions are cancelled.

If this action is successful, then the jwt property of this class instance is unset.


Copied to clipboard!
logout();

Usage #

Copied to clipboard!
const credentials = { username: 'foo', password: 'bar' };
try {
  await kuzzle.auth.login('local', credentials);
  await kuzzle.auth.logout();
  console.log('Success');
} catch (error) {
  console.error(error.message);
}