Skip to main content
These recipes cover the most common Client API integrations. They all assume the embed script is installed — see the overview and configuration.

Wait until the API is ready

The embed dispatches browser events when it is ready. Prefer listening for these instead of polling. If your code might run before or after the embed is ready, check once and then listen:
Polling fallback for older embed versions without events:

Auto-open on intent

Open the widget after a delay to invite engagement:

Open after scroll depth

Open the chat once the visitor scrolls past a threshold:

Trigger a product question

Inject a context-driven prompt from a product detail page. sendMessage opens the chat automatically if it is closed:
To trigger the custom product-question flow for a question set:

Attach metadata to the next message

Add context such as the current product before the visitor sends a message:
In a single-page app, clear stale metadata on navigation:

Read the chat history

Read the current conversation, for example to forward it to your own analytics:

Force a new conversation

Start a fresh conversation by setting newChat: true: