If you just want a “Chat with us” button, paste the prebuilt
<molin-shop-ai-button> instead. It is one HTML tag, no JavaScript, and you style it with a single bg attribute. Use this page when you need to wire up something custom.API
The embedded widget element exposes two methods you can call from anywhere on the page:document.querySelector('molin-shop-ai').openChat()opens the chat windowdocument.querySelector('molin-shop-ai').closeChat()closes it
Wire up your own button
Wrap any element in anonclick that calls openChat():
Make an existing element clickable
If you already have an image, banner, or text block you want to use as the trigger, wrap it in an anchor that callsopenChat():
Related
- Elements — drop-in HTML tags including the prebuilt chat button
- Send message programmatically — open the chat AND deliver a message in one call
- Show/Hide widget — control widget visibility