1-877-548-3001 Sign in About Contact
Developer

SDK Callback Functions

The following functions will be called if declared:

function lhnJsSdkReady(){
  // This function will be called when sdk is done loading and ready
}

function lhnJsSdkEmbeddedOpened(){
  // This function will be called when the embedded window is opened
}

function lhnJsSdkEmbeddedClosed(){
  // This function will be called when the embedded window is closed
}

function lhnStatusUpdate(){
  // This function will be called when the online/offline status of the department or account changes
}
*lhnJsSdk.isOnline variable will provide current online/offline status

function lhnJsSdkInviteReceived(message, delay, type){
  // This function will be called when a new chat invitation is received.
}

function lhnJsSdkInviteAccepted(){
  // This function will be called when a chat invitation is accepted.
}

function lhnJsSdkInviteRejected(){
  // This function will be called when a chat invitation is rejected.
}

function lhnJsSdkSmsChatShown(){
  // This function will be called when the sms chat is launched from the chat window.
}

function lhnJsSdkPreChatShown(){
  // This function will be called when the prechat form is shown.
}

function lhnJsSdkPreChatSubmitted(){
  // This function will be called when the prechat form is submitted.
}

function lhnJsSdkChatStarted(){
  // This function will be called when the chat has begun.
}

function lhnJsSdkChatNewMessage(message_id, message, message_type){
  // This function will be called when a new chat message is received.
}

function lhnJsSdkChatTimeout(message){
  // This function will be called when a chat timeout option is triggered.
}

function lhnJsSdkChatEnded(chat_session_id){
  // This function will be called when chat has been ended
}

function lhnJsSdkOfflineShown(){
  // This function will be called when the offline form is shown.
}

function lhnJsSdkOfflineSubmitted(){
  // This function will be called when the offline form is submitted.
}

function lhnJsSdkSurveyShown(){
  // This function will be called when a survey has been shown
}

function lhnJsSdkSurveySubmitted(){
  // This function will be called when a survey has been submitted
}

function lhnPromo(message){
  // This function will be called when a promo is received
}

function lhnJsSdkKbSearch(search_term){
  // This function will be called when a kb search is occuring
}

function lhnJsSdkTicketShown(){
  // This function will be called when a ticket form is shown
}

function lhnJsSdkTicketSubmitted(){
  // This function will be called when a ticket form is submitted
}

function lhnJsSdkCallbackShown(){
  // This function will be called when a callback form is shown
}

function lhnJsSdkCallbackSubmitted(){
  // This function will be called when a callback form is submitted
}

function lhnConversion(conversion_id, conversion_value){
  // This function will be called when a conversion is triggered
}

/* Only for Help Bot Chats */
function lhnJsSdkBotInputReceived(question, answer){
  // This function will be called when a Help Bot question is answered
}