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)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 webchat
appearance: {
    	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 header
appearance.avatarobjectObject to config avatar
        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 webchat

', themeColor: 'red' }```

appearance.styles.urlstringUrl to custom stylesheet

', }```

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 analytics
sessionIdstringField to continue already started conversation
sourceTypestringField to mark conversation with custom source name. Value will be visible in conversation analytics
initialMessageobjectObject to set up initial message. Thanks to it, bot can start from specific block
        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 function
        console.log('Chat is open');
    }```

onCloseChatfunctionCallback function
        console.log('Chat is closed');
    }```

onInitializedChatfunctionCallback function
        console.log('Chat is initialized');
    }```

onOpeningButtonClickfunctionCallback function
        console.log('User clicked to open chat');
    }```

onMessageSentfunctionCallback function called after send Message by user
        console.log('User send:' + userMessage);
    }```

onMessageReceivedfunctionCallback function called after send Message by useronMessageReceived: (messageReceived) => { console.log('Bot said:' + messageReceived.responses[0].text); }

Live example