Chat launcher script Link

<script src="https://cdn.sentione.com/chat-ui-launcher/chat.1.5.2.js"></script>

Fields in configuration object

Field name (* - required)TypeDescriptionExample value
chatSrc *stringURL: https://webchat.**ENV**.chatbots.sentione.com/fullscreenhttps://webchat.pre-stage.chatbots.sentione.com/fullscreen
projectId *stringProject id
appearanceobjectObject to set up appearance of the webchatappearance: { headerTitle: "Sentione chat", avatar: { src: '<https://cdn.sentione.com/chat-ui-launcher/avatars/avatar-male.png> ', showNearBubble: true, showInHeader: false, }, },
appearance.headerTitlestringUser will see it in headerheaderTitle: "Sentione chat",
appearance.avatarobjectObject to config avataravatar: { src: '<https://cdn.sentione.com/chat-ui-launcher/avatars/avatar-male.png> ', showNearBubble: true, showInHeader: false, },
appearance.avatar.srcstringUrl to custom avatar
appearance.avatar.showNearBubblebooleanDisplay setting of the avatar near to message bubble
appearance.avatar.showInHeaderbooleanDisplay setting of the avatar in chat header
appearance.inputPlaceholderstringPlaceholder of the inputinputPlaceholder: "Type something...",
appearance.stylesobjectObject to setup custom styles of webchatstyles: { url: '\<https\://cdn.sentione.com/chat-ui-launcher/themes/dark-blue.css> ', themeColor: 'red' }```
appearance.styles.urlstringUrl to custom stylesheetstyles: { url: '\<https\://cdn.sentione.com/chat-ui-launcher/themes/dark-blue.css> ', }```
appearance.styles.customCssstringCustom css rulesstyles: { customCss: '.chat-header__title {color: red;}', }
appearance.styles.themeColorstringMain color of webchatstyles: { themeColor: 'red', }
autoStartobject or numberField to setup auto open chat behavior.

- no field or -1 - chat will stay closed until user click to open manually
- 0 - chat will open automatically
- above 0 - chat will open after defined time
autoStart: { delayTime: 2000, }, ```or `autoStart: 2000`
autoStart.delayTimenumberTime to delay automatically open chatautoStart: 2000
authorstringName of the user, this value will be visible in Conversation analyticsauthor: 'John Doe',
sessionIdstringField to continue already started conversation
sourceTypestringField to mark conversation with custom source name. Value will be visible in conversation analyticssourceType: "SentiOne-chat",
initialMessageobjectObject to set up initial message. Thanks to it, bot can start from specific blockinitialMessage: { text: "", extraData: { process: "process_name" }, }, ```
initialMessage.textstringInitial message that will be sent to bot to start conversationtext: Say hello"
initialMessage.extraDataobjectInitial extraData that will be sent to bot to start conversationextraData: { process: "process_name" }
onOpenChatfunctionCallback functiononOpenChat: () => { console.log('Chat is open'); }```
onCloseChatfunctionCallback functiononCloseChat: () => { console.log('Chat is closed'); }```
onInitializedChatfunctionCallback functiononInitializedChat: () => { console.log('Chat is initialized'); }```
onOpeningButtonClickfunctionCallback functiononOpeningButtonClick: () => { console.log('User clicked to open chat'); }```
onMessageSentfunctionCallback function called after send Message by useronMessageSent: (userMessage) => { console.log('User send:' + userMessage); }```
onMessageReceivedfunctionCallback function called after send Message by useronMessageReceived: (messageReceived) => { console.log('Bot said:' + messageReceived.responses[0].text); }

Live example