Beacon Usage - Overview
Importing beacon
import the beacon module in the same way as in a regular JavaScript environment:
import { Beacon } from '@beacon.li/bar';
Loading Beacon
To load beacon in your application, use the Beacon.load
method and pass your organization ID as a parameter. Replace 'ORG_ID'
with your actual organization ID:
Beacon.load('ORG_ID');
If you want to use a <script> tag instead, then you can try as below. Replace your ORG_ID with your actual organization ID
<script>
(function(b,e,a,c,o,n) {b[c] = {orgId:n, open:()=>{b[c].opened=true}};
var s = e.createElement(a);
s.src='https://cdn.beacon.li/sdk/latest.js';s.async=true;s.type='module';
var d = e.createElement(o);
d.id='beacon-user';
e.body.appendChild(d);
e.head.appendChild(s);
})(window, document, 'script', 'BeaconBar', 'div','ORG_ID');
</script>
To get your organization ID, go to beacon dashboard, open beacon bar using CMD/Ctrl + K and search for 'Copy Org ID'
Last updated