Full-screen modal
Open the Shop Agent over the current page from a button, banner or search field. On desktop and mobile, shoppers can close the conversation to return to that page.
Open the agent
Section titled “Open the agent”Neocom.askAgent("YOUR_ASSISTANT_ID", { display: "modal" });Call the AskAgent once the Global script is ready. The display option opens the agent without sending a message. Include the appropriate message type, content and any product context to send a question in the same call.
A button that opens the agent
Section titled “A button that opens the agent”Render the button disabled, enable it when the API is available, and open the modal on click. Place the handler after its button in your markup. The readiness check handles either load order.
<button id="neocom-open-agent" type="button" disabled>Ask our Shop Agent</button><script> (function () { const button = document.getElementById("neocom-open-agent"); function enableButton() { button.addEventListener("click", function () { Neocom.askAgent("YOUR_ASSISTANT_ID", { display: "modal" }); }); button.disabled = false; } if (window.Neocom) enableButton(); else window.addEventListener("neocomloaded", enableButton, { once: true }); })();</script>For a search box or a button that includes product context, use the AskAgent examples.
Close, continue, restart
Section titled “Close, continue, restart”- Close. The X returns the shopper to the same scroll position. Test that scrolling works and keyboard focus returns to the trigger. If you launch from a search overlay, dismiss it and release its scroll lock first.
- Continue: closing does not end the conversation. Reopening the modal for the same Assistant ID continues it, while the conversation can still be resumed.
- Restart. The second control in the top bar asks the shopper to confirm before starting a new conversation.
Combining with other entry points
Section titled “Combining with other entry points”- Add a chat bubble for the same assistant if shoppers should be able to continue there after closing the modal.
- Existing bubble and inline integrations keep working after the modal closes; test this in the verify step of the Quickstart.