...
Code Block | ||
---|---|---|
| ||
$(document).ready( function() { $.getScript("https://mywebsite.com/livechat/:domain/lib/livechatagentsdk.js") .then(function() { function() { // Initialize the CTLive SDK return LIVECHATSDK.SDK.Initinit("https://mywebsite.com/livechat/:domain/") }) ).then(function() { // Login function() {the agent to CTLive //jwt is optional. CTLive Agent's SDK library loaded //If not provided a redirect towards //IdentityProvider Callis libraryrequested initialization... return LIVECHATSDK.LIVECHAT.init(login(jwt); }) .then(function(){ return LIVECHATSDK.LIVECHAT.init({ "nickname": "Agent1", "isAgent": true, "id": "USER_AGENT1", "channel": "web" } ); }) ).catch( function(err) { console.error(err); } ); } ); |
CTLive SDK needs to be initialized specifying some parameters:
domain: unique domain identifier
nickname: a friendly id that identifies the user. Questa stringa verrĂ utilizzata nella trascrizione della chatThis string will be used in the chat transcript.
isAgent: a true/false value that identifies the user as a call center agent
id: unique user identifier
channel:
web
is the default value, otherwisewhatsapp
identify an engagement from the WhatsApp mobile application