v189
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) | Type | Description | Example value |
|---|---|---|---|
| chatSrc * | string | URL: https://webchat.**ENV**.chatbots.sentione.com/fullscreen | https://webchat.pre-stage.chatbots.sentione.com/fullscreen |
| projectId * | string | Project id | |
| appearance | object | Object to set up appearance of the webchat | |
| appearance.headerTitle | string | User will see it in header | |
| appearance.avatar | object | Object to config avatar | |
| appearance.avatar.src | string | Url to custom avatar | |
| appearance.avatar.showNearBubble | boolean | Display setting of the avatar near to message bubble | |
| appearance.avatar.showInHeader | boolean | Display setting of the avatar in chat header | |
| appearance.inputPlaceholder | string | Placeholder of the input | inputPlaceholder: "Type something...", |
| appearance.styles | object | Object to setup custom styles of webchat | |
| appearance.styles.url | string | Url to custom stylesheet | |
| appearance.styles.customCss | string | Custom css rules | styles: { customCss: '.chat-header__title {color: red;}', } |
| appearance.styles.themeColor | string | Main color of webchat | styles: { themeColor: 'red', } |
| autoStart | object or number | Field to setup auto open chat behavior.
| |
| autoStart.delayTime | number | Time to delay automatically open chat | autoStart: 2000 |
| author | string | Name of the user, this value will be visible in Conversation analytics | |
| sessionId | string | Field to continue already started conversation | |
| sourceType | string | Field to mark conversation with custom source name. Value will be visible in conversation analytics | |
| initialMessage | object | Object to set up initial message. Thanks to it, bot can start from specific block | |
| initialMessage.text | string | Initial message that will be sent to bot to start conversation | text: Say hello" |
| initialMessage.extraData | object | Initial extraData that will be sent to bot to start conversation | extraData: { process: "process_name" } |
| onOpenChat | function | Callback function | |
| onCloseChat | function | Callback function | |
| onInitializedChat | function | Callback function | |
| onOpeningButtonClick | function | Callback function | |
| onMessageSent | function | Callback function called after send Message by user | |
| onMessageReceived | function | Callback function called after send Message by user | onMessageReceived: (messageReceived) => { console.log('Bot said:' + messageReceived.responses[0].text); } |
