Developer/IT > Whisbi API > API Reference > Events > Introduction

Introduction

These are all the events of the Whisbi widgets. Use them to bind listeners to specific events in the Whisbi experience, in order to trigger actions in your part when they occur.

EXAMPLE

var conf = {
version: '1.32.0',
api: {...},
general: {...},
oneToMany: {...},
oneToOne: {...},
events: {
checkScoreBeforeWidgetLoaded: checkScoreBeforeWidgetLoaded,
widgetLoaded: widgetLoaded,
otoCmbRequested: otoCmbRequested,
otoPreSessionRequest: otoPreSessionRequest
}
};
whisbi.setup(conf);

function checkScoreBeforeWidgetLoaded() {
console.log('Widget with scoring data');
}

function widgetLoaded() {
console.log('Widget loaded');
}

function otoCmbRequested(data) {
console.log('Lead:', data.lead);
}

function otoPreSessionRequest (data, done) {
// Modify data received
data.callCenters = ['callCenter_01', 'callCenter_02'];
data.customer.extra = 'extra info';
// Send back data modified to request a session
done(result);
}
Copy Code