Behaviour and timing
When the widget speaks first, how long it waits, when it offers a human, and the JavaScript API for driving it from your own code.
On this page
Timing settings
These live under Advanced on each chatbot. The defaults are tuned for a typical marketing site; change them if your traffic behaves differently.
| Setting | Default | Effect |
|---|---|---|
| Greeting delay | 3,000 ms | How long after page load the proactive greeting bubble appears. |
| Handoff form delay | 0 ms | Pause between the chatbot offering a human and the handoff form appearing. Raise it to let the visitor finish reading. |
| Frustration window | 30,000 ms | The rolling window used to detect a struggling visitor. |
| Frustration threshold | 3 messages | How many messages inside that window trigger a proactive offer of a human. |
| Typing timeout | 2,000 ms | How long the typing indicator lingers after the last keystroke. |
| Queue timeout | 20 s | How long a visitor waits in the live-chat queue before falling back to the offline form. |
| Maximum queue size | 10 | Past this, new handoff requests get the offline form instead of a queue slot. |
Connection handling
During a live chat the widget holds a real-time connection. If the network drops it reconnects automatically with a backing-off delay, up to 15 attempts and a maximum 30-second gap, and it heartbeats less often while the tab is in the background to save battery.
Separate disconnect timeouts decide when a silent participant is treated as gone: 120 seconds for a visitor, 60 for an operator, both configurable per chatbot.
JavaScript API
The widget exposes window.OyeChats. Calls made before the bundle finishes loading are queued and replayed, so you do not need to wait for a ready callback before calling a method.
| Method | What it does |
|---|---|
OyeChats.init() | Mounts the widget. Only needed with OYECHATS_ASYNC_INIT. |
OyeChats.destroy() | Unmounts the widget and removes its container. |
OyeChats.open() | Opens the chat panel. |
OyeChats.close() | Closes the chat panel. |
OyeChats.toggle() | Toggles the panel. |
OyeChats.send("text") | Opens the panel and sends a message as the visitor. |
OyeChats.boot() | Starts a fresh conversation, discarding the stored one. |
OyeChats.shutdown() | Ends the session and clears the stored conversation. Use this on logout. |
OyeChats.diagnose() | Logs and returns a diagnostic snapshot. Useful in a support ticket. |
OyeChats.version | The loaded bundle version. |
Events
Subscribe with on, once and off. Three events are emitted today:
| Event | Fires when |
|---|---|
ready | The widget has mounted. Payload carries the bundle version. |
open | The chat panel opens. |
close | The chat panel closes. |
// Open the chat from your own button.
document.querySelector('#help').addEventListener('click', () => {
window.OyeChats.open();
});
// Or open it with a question already asked.
window.OyeChats.send('How do I change my plan?');
// React to the widget mounting.
window.OyeChats.on('ready', ({ version }) => {
console.log('OyeChats ready', version);
});
// Clear the conversation when your user signs out.
function onLogout() {
window.OyeChats.shutdown();
}window.OYECHATS_DEBUG = true before the script loads for verbose console output while you are integrating.Something here wrong or missing? Tell us and name this page. We will fix it.