Plain HTML
Install ShopAssist with a script tag, no build step.
If your storefront has no build step, install the widget with a script tag.
<script>
window.ShopAssistConfig = {
shopDomain: "your-shop.com",
platform: "custom",
apiUrl: "https://api.getshopassist.com",
};
</script>
<script src="https://widget.getshopassist.com/shop-assist.js" defer></script>Paste it once, immediately before the closing </body> tag, in a template that
renders on every page.
Order matters. The widget reads window.ShopAssistConfig as it loads and never
looks again, so the configuration block must come first.
Opening the chat from your own button
<button onclick="window.ShopAssist.open()">Chat with us</button>open also takes a message, which the assistant answers as the first turn:
window.ShopAssist.open({ message: "Do you ship to Germany?" });Product URLs
The widget builds product links as /products/<handle>. If your paths differ,
describe them:
<script>
window.ShopAssistConfig = {
shopDomain: "your-shop.com",
platform: "custom",
apiUrl: "https://api.getshopassist.com",
custom: {
currency: "EUR",
language: "sl",
country: "SI",
productUrlPattern: "/izdelek/{handle}",
productPagePattern: "/izdelek/([^/?#]+)",
},
};
</script>Checking the install
Load any page. A floating chat button appears in a corner, and the console shows
ShopAssist v… initialized.
If the console is silent, window.ShopAssistConfig was not defined when the
widget script ran. Seeing window.ShopAssist in the console is not enough; that
only means the script loaded.
You can also ask the API directly:
curl -H "X-Shop-Domain: your-shop.com" \
https://api.getshopassist.com/api/widget/settingsThe response includes "pluginEnabled": true when the shop is live.
Next steps
- Show question pills on a product page.
- Attribute orders back to conversations.
Last updated on