The chat assistant exposes a JS API onDocumentation Index
Fetch the complete documentation index at: https://developers.gotolstoy.com/llms.txt
Use this file to discover all available pages before exploring further.
window.tolstoyAssistant once the Tolstoy widget script has loaded. Use it to open, close, minimize, or observe the assistant modal from your own UI (custom CTAs, product pages, exit-intent triggers, etc.).
The API only controls the assistant modal state. The assistant must already be installed and enabled on the store. If the chat bubble is not rendered on the page, state changes are still tracked but have no visual effect.
open()
Open the assistant modal.close()
Close the assistant modal. The bubble stays visible (unless configured to hide on close).minimize()
Minimize the assistant modal. The bubble stays visible; the conversation is preserved.isOpen()
Returnstrue when the assistant modal is currently open.
getState()
Returns the current assistant state.subscribe(listener)
Subscribe to state changes. Returns an unsubscribe function.Called every time the assistant state changes.