onClose

Called when a user has closed your Okra Widget

The onClose callback is called when a user exits the Okra Widget flow. It takes two arguments, a nullable error object and a metadata JSON object. The metadata parameter is always present, though some values may be null.

import Okra from 'npm-okrajs';

const OkraHandler = Okra.buildWithOptions({
  ...,
  onClose: (json, error) => {
        console.log('Uh oh, you closed the widget', json)
  }
});

What's Next

See what happens if something goes wrong on the widget.

Did this page help you?