1-877-548-3001 Sign in About Contact

Optional SDK Settings

Please note all options below should be defined within the window.lhnJsSdkInit function declaration.

When using the javascript SDK you have the ability to customize some options directly on your page. For example, the local dictionary being used and some visitor and window options. Please see the example below for both.

lhnJsSdk.dictionary = {
  agentConnecting: "Connecting to agent",
  callbackMenu: "Callback",
  callbackTitle: "Request a callback",
  cancel: "Cancel",
  chatBoxPlaceholder: "Your message",
  chatMenu: "Chat",
  chatTitle: "Conversation",
  email: "Email",
  emailTranscript: "Email transcript to",
  emailSuccess: "Chat transcript has been emailed to",
  endChat: "End Chat",
  endChatConfirm: "Are you sure you want to end the current chat?",
  file_upload_description: "Click here or drop a file to add up to 5 attachments. Use buttons below to submit or delete all attachments.",
  hide: "hide",
  inviteCancel: 'Dismiss',
  inviteStart: 'Chat now',
  knowledgeMenu: "FAQ",
  knowledgeSearch: "",
  knowledgeTitle: "Search Knowledge",
  livechat: "LIVE CHAT",
  livechat_offline: "GET HELP",
  newChatTitle: "New conversation",
  offlineTitle: "Leave a message",
  remoteAssistance: "The agent is requesting access to view your desktop",
  send: "Send",
  startChat: "Start Chat",
  submit: "Submit",
  ticketMenu: "Ticket",
  ticketTitle: "Submit a ticket",
  uploadFile: "Upload File",
  uploadFileSuccess: "File has been successfully uploaded",
  error_msg_empty: "",
  error_msg_email: "",
  error_msg_phone: "",
  error_msg_url: ""
lhnJsSdk.options = {
  custom1: "Some value<br />Blah Blah", //custom1 value -- 350 character limit
  custom2: "Another value", //custom2 value -- 350 character limit
  custom3: "One more value", //custom3 value -- 350 character limit
  custom1Label: "Custom1 label", //custom1Label text -- 150 character limit
  custom2Label: "Custom2 label", //custom2Label text -- 150 character limit
  custom3Label: "Custom3 label", //custom3Label text -- 150 character limit
  dept: 12345, //passing of department id
  autoinvite: {
    message: "Auto invite message", //the message of the auto invite
    enabled: true, //if the auto invite in enabled or not
    delay: 15 //the delay of the invite in seconds
  chatSurveyId: 12345, //the survey id you would like to use
  chatWindowId: 12345, //the chat window id you would like to use
  callbackWindowId: 12345, //the callback window id you would like to use
  kb_categories: [1, 2, 3], //the categories you would like to restrict the kb search to
  tracking: true, //if the visitor should be tracked or not
  hideButtonWhenOpen: true, //if the button should hide when the embedded window is open
  embedArticle: true, //set to true to show KB article directly in HOC window or false to open on KB site
  sound: "http://url.com/to/customsound.wav", //can supply a custom audio file to play for visitor notifications or set to empty string ("") to disable sound
  invite_as_chat: false //will show invitation message as a chat message. This will bypass any prechat setup
  disableChatInQueue: true //will disable the visitor from typing and sending messages when sitting in the chat queue.
  disableEndChat: true //will disable the visitor from terminating the chat
  disableCookies: false //will force all storage to use browser local storage instead of cookies

You can also pre supply any data you already know. The keys will need to match the CRM mapping defined in the form customization pages in the Admin Panel. All keys would be lowercase with spaces becoming underscores. For example we will use the EMail and Full name mappings below:

lhnJsSdk.fieldData = {
  email: "user@domain.com", //mapping to the EMail CRM field
  full_name: "Customer Name", //mapping to the Full name CRM field.
  auto_submit: false //set to true to auto submit the pre chat form with supplied info

You may add _readonly to the end of any key to prevent the customer from being able to modify the supplied value.