API Reference

Everything you need to do to get started with Business Score widget.js.

Step 1 : Installation

You need to include widget.js on your web page by adding the script tag to the head of your HTML file.

<script src="https://wdjs-s.scorethebusiness.com/widget.js"/></script>

Step 2 : Instantiation

Next, create an instance of the Widget by providing your public API key as the first parameter; along with elementId parameter.

publicKey //This is required, provided by Business Score and allows you to instantiate your widget instance.
elementId //This is the HTML element id, where you want the widget to be displayed

<script>
  var widget = BusinessScoreWidget({
    publicKey: 'pk_123213123', 
    elementId: 'bs-widget-popup',
 });
</script>

Step 3 : Execution

Call the widget.show()` method on the instance you created in step 2, to display the widget.

<body onload="widget.show()">