First of all, you need your INSTANCE_ID (i.e. client-instance-id) from our Account Manager, Appointed Lead Developer or alternatively contact our Support team. The possible values for ENVIRONMENT are: 'liv' (to use in live environment) and 'stag' (to use in staging environment).
The library must be included inside your code before using the API. This piece of code should be inserted at the bottom of the page:
STAGING environment resources import
LIVE environment resources import
Once the library is added to the page, you need to create an instance of the service (It is no longer necessary to call the init() method):
var empathySearch = new EmpathyBrokerSearch(INSTANCE_ID, ENVIRONMENT);
var empathySearch = new EmpathyBrokerSearch('client-instance-id', 'stag');
At this point, you are ready to use the library: