Beemray SDK for Web

Follow

The Beemray Web SDK contains the Javascript code necessary to integrate Beemray functionalities with your website. This SDK is designed to work across all browsers. This SDK works by including just a tiny block of Javascript code to your website.

Prerequisite: you need to make sure that your website can receive the Beemray Web SDK. To do that you need to configure page on Admin UI.

Beemray Web SDK script can be loaded by the below style which is asynchronous.

Integration

<body>
<script>
document.addEventListener("beemrayOnLoad", function() {
/* Starts the Beemray Web SDK. */
beemray.Initialize.instance().register();
});

(function (doc, type) {
var websdk = doc.createElement(type),
script = doc.getElementsByTagName(type)[0];
websdk.async = true;
websdk.src = "https://honeypot.beemray.com/api/js/APIKEY/loader.js";
script.parentNode.insertBefore(websdk, script);
websdk.parentNode.removeChild(websdk)}(
document, 'script'));
</script>
</body>
Beemray device identifier from callback

If you want to get the Beemray device unique identifier of the current device, just add an callback function for Beemray.Initialize.instance().register() function with ID as a parameter on Beemray Web SDK start.

/* Starts the Beemray Web SDK */
beemray.Initialize.instance().register(function(deviceId) {
/* do something with the ID */
console.log(deviceId);
});

 

The only required configuration parameter is your Beemray API key.

NOTE!

APIKEY should be replaced with your own API key which can be found on Beemray Admin when you login.

Have more questions? Submit a request

Comments