JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://cdn.sentione.com/chat-ui-launcher/chat.1.5.2.js"></script>
JavaScript
window.sentiOneChat.initWebChat({
chatSrc: `https://webchat.app.chatbots.sentione.com/fullscreen`,
projectId: '4f73764a-a199-47c1-9bdb-fc1faed146f9',
sourceType: "SentiOne-chat-demo",
author: 'John Doe',
appearance: {
inputPlaceholder: "Type some message",
headerTitle: "Sentione chat Demo",
avatar: {
src: 'https://cdn.sentione.com/chat-ui-launcher/avatars/avatar-male.png',
showNearBubble: true,
showInHeader: true,
},
},
//sessionId: "",
autoStart: 2000,
initialMessage: {
extraData: { process: "kredyt-hipoteczny" },
},
onOpenChat: () => {
console.log(34, 'open chat');
},
onCloseChat: () => {
console.log(34, 'close chat');
},
onMessageSent: (message) => {
console.log('message', {message});
},
onMessageReceived: (response) => {
console.log({response});
}
})