Skip to main content

SDK installation (EN)

SDK#

Add this code right after the opening <body> tag, and replace YOUR_ACCOUNT_ID with your actual account id.

<script>
window.beOpAsyncInit = function() {
BeOpSDK.init({
account: "YOUR_ACCOUNT_ID"
});
BeOpSDK.watch();
};
</script>
<script async src="https://widget.beop.io/sdk.js"></script>

Declaring slots#

You can declare slots, or places where widgets should appear by simply putting the following tag where you want them on your pages:

<div class="BeOpWidget"></div>

In order to ensure your slots are correctly filled, we highly recommend naming them, this way if the slot order in your page is altered, the SDK will still be able to identify them.

Example:

<div class="BeOpWidget" data-name="below-article"></div>
<div class="BeOpWidget" data-name="sidebar"></div>
<div class="BeOpWidget" data-name="homepage"></div>

For more technical details, go the SDK documentation.