SDK
SDK Javascript v7.x
2

authenticate #

Authenticate the SDK by using the function set in the authenticator property.

Arguments #

Copied to clipboard!
authenticate();

Usage #

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