on

client.on(eventName: Event, callback: function)

About this command

Add a listener for a particular ReachFive event.

Examples

client.on('authenticated', authResult => {
  const accessToken = authResult.accessToken
  // ...
})

Parameters

eventName Event

One of the following events:

  • authenticated: emitted after a successful authentication.

  • authentication_failed: emitted after a failed authentication with a social provider.

  • login_failed: emitted after a failed password or Webauthn login.

  • signup_failed: emitted after a failed signup.

  • profile_updated: emitted after a successful profile update.

  • ready: emitted when the SDK is fully loaded. If the SDK is already loaded, the handler is called synchronously.

callback function

The function called when the event occurs.

Response

Type: void