Embeddable assistant
A shop's shopping assistant on a site Storeware does not host, from one script tag.
The embeddable assistant puts a shop's shopping assistant on a site that Storeware does not host, such as a merchant's own blog or marketing pages. It is one script tag, with no framework and no build step.
The admin does not hand out the script's address or a shop's publishable token yet. To embed the assistant on a site now, write to storeware.ai/contact.
The tag
<script src="…/assistant.js" data-token="swp_your_publishable_token"></script>| Attribute | Meaning |
|---|---|
data-token | The shop's publishable token. Required: without it the script does nothing. |
data-label | The text on the closed launcher button. |
data-placeholder | The placeholder in the question box. |
data-scheme | light or dark. Without it, the assistant follows the reader's own preference. |
data-api-origin | Where the API lives, for development. |
The script can sit in <head>: it waits for the page's body before it draws.
What it does
A launcher button opens a panel where a shopper asks about the shop's products. Answers stream in as they are written, with product cards that link to the shop's own product pages. The panel says it is an AI assistant before anybody asks anything.
A conversation is remembered for the browser tab, so a shopper who reloads the page carries on where they were. Two shops embedded on one site keep separate conversations.
How it stays out of your page
- A closed shadow root. The assistant draws inside its own shadow DOM, so your page's styles cannot reach it and its styles cannot leak out. Your own scripts cannot reach into it either.
- No framework. It is plain DOM, so it adds no second copy of a library your page may already load.
- Its own colours. It uses the platform's light or dark tokens, set inside the shadow root.
The token is public
A publishable token is printed in page source, and that is expected. It can browse the shop and start a basket. It cannot read a draft product, an order or a customer record. A token can be pinned to a list of origins, and then a request from any other origin is refused.