CommerceOS

Widget & API

Embed options

Attributes on the script tag: display mode, placement and launcher.

Add these attributes to the install code's <script> tag.

AttributeValuesWhat it does
data-public-keyyour keyRequired. Identifies your assistant.
data-modewindow (default), fullscreen, inlineA floating window, the whole screen, or embedded in the page.
data-targeta CSS selectorWhere to put the chat — use with inline, e.g. #chat.
data-launcherhiddenDon't show the chat button. Use the JavaScript API to open it.
data-service-workera path, e.g. /cos-sw.jsLets visitors opt in to reply notifications. See Visitor notifications.
data-api-urla URLOnly needed if you serve the script from your own host.

Inline on a page

<div id="chat" style="height: 600px"></div>
<script src="https://cdn.selfserve.cosmos.hub.nortq.com/v1/chat.js" data-public-key="pk_live_your_key" data-mode="inline" data-target="#chat" defer></script>