JS Client On SDK

The JS-Client can be a useful tool to perform specific actions or to create a new custom component.


The JS-Client is a property of the SDK. You can use it after the SDK is initialized. You must wait until the SDK is ready before you can use it. For more information, see JS-Client.

sdk.client.untilReady().then( function (response) {

When you use the Last chance component, you must send the contact_ticket event when the user send a ticket. To send this event, you must use the client. For more information, see Last chance.

The following example sends the event after a user clicks on the "Submit" button:

var lastChance = sdk.component('lastChance', '#last-chance', {});
// Submit form
document.getElementById('form').addEventListener('submit', function(event) {
lastChance.$on('submit', function() {
    // Send ticket
    <code to send the ticket>
    // Track the contact_ticket event
            'value': lastChance.getQuery()

If you want to manage clicks from external instances, you must use the client to send the external_click event. For more information, see External management page.

//SDK creation
var sdkA = InbentaKmSDK.createFromDomainKey("Domain_Key_instance_a","API_Key_instance_a");
var sdkB = InbentaKmSDK.createFromDomainKey("Domain_Key_instance_b","API_Key_instance_b");

//Searchbox creation
var searchBox = sdkA.component('searchBox', '#search-box'); //sdk of the searchBox is not important

//Results creation
var resultsA = sdkA.component('results', '#resultsA');
var resultsB = sdkB.component('results', '#resultsB');

//Manage click in instance A to send external click to instance B
resultsA.$on('expand', function(content){

//Manage click in instance B to send external click to instance A
resultsB.$on('expand', function(content){