Widget & API
Embed options
Attributes on the script tag: display mode, placement and launcher.
Add these attributes to the install code's <script> tag.
| Attribute | Values | What it does |
|---|---|---|
data-public-key | your key | Required. Identifies your assistant. |
data-mode | window (default), fullscreen, inline | A floating window, the whole screen, or embedded in the page. |
data-target | a CSS selector | Where to put the chat — use with inline, e.g. #chat. |
data-launcher | hidden | Don't show the chat button. Use the JavaScript API to open it. |
data-service-worker | a path, e.g. /cos-sw.js | Lets visitors opt in to reply notifications. See Visitor notifications. |
data-api-url | a URL | Only 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>