What it does

The Javascript Event Button emits a custom JavaScript event, facilitating the execution of additional scripts in response.

Configuration

Basic Configuration

Configuration OptionDescription
Button TextThis is the text displayed on the button on the dashboard. It defaults to “JS Event”
JS Event NameSpecifies the custom JavaScript event name to emit. Note: Leaving this field blank will disable the button.

The detail body that is passed with the javascript event contains the customerName and the customerProvidedId for the customer who clicked the button.

Example Code

<!DOCTYPE html>
<html lang="en">
  <head>
    <script>
      const messageListener = (e) => {
        console.log(e.detail);
      };
      window.addEventListener("EVENT_NAME", messageListener);
    </script>
  </head>
  <body>
    <explo-dashboard
      dash-jwt="<your-jwt>"
    />
  </body>
</html>