0.0.1 • Published 1 year ago

smoc-widget v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Build

Smoc Widget

Smoc Widget is a JavaScript library for embedding the Smoc bot on a web page:

button

Clicking the button will open the bot:

iframe

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/smoc-widget@1.0.0';
        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)
0.0.1

1 year ago