Documentation Index
Fetch the complete documentation index at: https://docs.yourhomie.ai/llms.txt
Use this file to discover all available pages before exploring further.
This page documents the client-side Browser API exposed by the embed script. For server-side REST endpoints, see
your API Reference.
Overview
Once the Homie embed script is loaded, a global objectwindow.homieBot becomes available.
Use it to open/close the widget, check its state, send messages programmatically, and read the chat history.
Requirements
- The script must be embedded on your page.
chatbotIdanddomainmust be set.storeIdis optional and can be passed when needed.
Browser events
The embed dispatches custom browser events onwindow so you can hook into lifecycle and interaction without polling:
| Event | When |
|---|---|
homiebot:api-ready | window.homieBot is available |
homiebot:assistant-ready | Chat iframe is loaded; sendMessage / getHistory work |
homiebot:opened | Chat widget was opened |
homiebot:closed | Chat widget was closed |
{ chatbotId } in event.detail. See the examples page for listener snippets.
TL;DR
| Method | Purpose |
|---|---|
open() | Open the chat |
close() | Close the chat |
toggle() | Toggle open/closed |
isOpen() | Read current state |
sendMessage(input, options?) | Inject a message (with retry/timeout) |
getHistory() | Read the current history |
updateMessageMetadata(metadata) | Add metadata to the next user message |