Widget & API
Visitor notifications
Let visitors get a notification when your team replies.
If a visitor leaves before your team replies, they can opt in to a browser notification. This needs one small file on your own website, because browsers only allow notification workers from the site itself.
Host the worker file
Create a file at the root of your site called
cos-sw.jscontaining this single line:importScripts("https://cdn.selfserve.cosmos.hub.nortq.com/v1/sw.js");Point the widget at it
Add
data-service-worker="/cos-sw.js"to your install code, or passserviceWorker: "/cos-sw.js"tocreateChat.
Visitors are then offered "notify me when someone replies" in the chat. Nobody is asked unless the worker is set up.