Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The library instance must be initialized by specifying some basic parameters such as the CTLive server domain, the engagement channel (web), the user ID and the nickname.

Code Block
languagejs
$(document).ready(
  function() {
    return $.getScript("https://mywebsite.com/livechat/lib/livechatagentsdk.js"

...

)
    .then( 
      function

...

() {
        return LIVECHATSDK.SDK.Init("https://mywebsite.com/livechat/")

...


      }
    

...

).then(

...


...

      function() {
        // CTLive Agent's SDK library loaded
        

...

// Call library initialization...

...


        LIVECHATSDK.LIVECHAT.init(

...


          

...

{

...


          "nickname": "Agent1",

...


          

...

"isAgent": true,
          

...

"id": "USER_AGENT1",

...


          

...

"channel": "web

...

"

...


          

...

}

...


        

...

)

...

;

...


      

...

}

...


    

...

)

...

.catch(
      

...

function(err) {
        

...

console.error(err);
      

...

}
    

...

);
  

...

}

...


...

);

...