smoc-widget2
v0.0.1
Published
Add a Smoc Bot to your web page
Downloads
0
Readme
Smoc Widget
Smoc Widget is a JavaScript library for embedding the Smoc bot on a web page:
Clicking the button will open the bot:
Installation
Paste the <script>
tag below into the pages where you want to enable the Smoc bot.
We recommend you add this right before the closing </head>
tag.
<!-- Smoc Bot -->
<script>
(function(d, w) {
w.SmocConfig = {
conversationTemplate: 'YOUR-CONVERSATION-TEMPLATE-ID',
color: '#ffeeed',
shape: 'round', // or 'square'
position: 'bottom-left' // or 'bottom-right'
}
var s = d.createElement('script');
s.async = true;
s.src = 'https://unpkg.com/smocai/[email protected]';
if (d.head) d.head.appendChild(s);
})(document, window);
</script>
You'll find your SmocConversationTemplateId
inside Smoc Console.
Configuration
You can customize various visual attributes of the widget:
- Color
- Shape (round or square)
- Position (bottom right, top right etc)