OyeChats
FeaturesSolutionsIntegrationsPricingDocsBlogContact us

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.

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.

SettingDefaultEffect
Greeting delay3,000 msHow long after page load the proactive greeting bubble appears.
Handoff form delay0 msPause between the chatbot offering a human and the handoff form appearing. Raise it to let the visitor finish reading.
Frustration window30,000 msThe rolling window used to detect a struggling visitor.
Frustration threshold3 messagesHow many messages inside that window trigger a proactive offer of a human.
Typing timeout2,000 msHow long the typing indicator lingers after the last keystroke.
Queue timeout20 sHow long a visitor waits in the live-chat queue before falling back to the offline form.
Maximum queue size10Past 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.

MethodWhat 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.versionThe loaded bundle version.

Events

Subscribe with on, once and off. Three events are emitted today:

EventFires when
readyThe widget has mounted. Payload carries the bundle version.
openThe chat panel opens.
closeThe chat panel closes.
JavaScript
// 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();
}
Debug logging. Set 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.