window.homieBot is undefined
window.homieBot is undefined
The object only exists after the embed initializes, so reading it on page load can return
undefined.- Confirm the script actually loads. Check the browser Network tab for
embed.min.jsreturning200. - Confirm
chatbotIdis set on the script tag or inwindow.homieBotConfig. Without it, the embed logs an error and stops. - Listen for the
homiebot:api-readyevent instead of accessingwindow.homieBotdirectly. - For older embed versions or late-bound code, use the
waitForHomie()polling fallback from the examples.
Messages are not sending
Messages are not sending
sendMessage and getHistory need the chat iframe to be ready, not just window.homieBot.- Wait for the
homiebot:assistant-readyevent, or checkwindow.homieBot.isReady()before sending. - The iframe loads lazily on first open. If you call
sendMessageit opens the chat and waits internally, but the promise rejects if the iframe never becomes ready (for example if it is blocked). - Check that the site does not block iframes via a strict Content Security Policy (CSP), and that third-party scripts are not delayed past
document.readyState === "complete".
Origin or domain mismatch
Origin or domain mismatch
The embed validates every
postMessage against the configured domain, and silently drops messages from any other origin.- Make sure the
domainattribute (orhomieBotConfig.domain) exactly matches the origin serving the chat —https://chat.yourhomie.aiin most cases. - A trailing slash or
httpvshttpsmismatch is enough to break it. - If the chat opens but replies never arrive, verify the API base for your environment is reachable (
api.yourhomie.ai).
Metadata persists across pages in an SPA
Metadata persists across pages in an SPA
Metadata set with
updateMessageMetadata() lives in the global window context and is not cleared on client-side navigation.- Clear stale keys on every route change by calling
updateMessageMetadata()withnullvalues. - Remember the per-call limits: max 5 keys, key ≤ 50 characters, value ≤ 100 characters.
The widget is not visible
The widget is not visible
The embed loads but no launcher button or chat appears.
- The assistant may be inactive or set to private on the platform — the embed exits early in those cases.
- A page configuration may hide the chatbot on the current URL.
- The launcher can sit behind sticky headers or badges. Increase
shadowHostZIndexin your platform style settings to lift it above other elements. - The launcher button may be intentionally hidden (
hideToggleButton); in that case open the chat yourself withwindow.homieBot.open().
FAQ
Can I force a new conversation? Yes —sendMessage({ text: '...', newChat: true }).
Can I read the widget state without opening it?
Yes — isOpen() returns the current state and does not change the UI.
How do I know the iframe is ready for messages?
Check isReady() or listen for the homiebot:assistant-ready event.