Skip to content

API Reference

After the loader script runs, the widget API is available at window.receiveo.api.

Opens the chat window and focuses the message input.

receiveo.api.open();

If the window is already open, this is a no-op (but still focuses the input).


Closes the chat window.

receiveo.api.close();

If hideBubbleOnClose is enabled, this also hides the bubble.


Toggles the chat window between open and closed.

receiveo.api.toggleWindow();

New

Shows the chat bubble.

receiveo.api.showBubble();

No-op if the bubble is already visible. Emits the bubble:show event.


New

Hides the chat bubble.

receiveo.api.hideBubble();

No-op if the bubble is already hidden. Emits the bubble:hide event.


New

Toggles the hide-bubble-on-close behavior at runtime.

ParameterTypeDescription
enabledbooleantrue to hide bubble when chat closes, false to keep it visible
// Enable: closing the chat also hides the bubble
receiveo.api.setHideBubbleOnClose(true);
// Disable: closing the chat leaves the bubble visible
receiveo.api.setHideBubbleOnClose(false);

New

Registers an event listener. Returns an unsubscribe function.

ParameterTypeDescription
eventstringEvent name — see Events below
callback() => voidFunction to call when the event fires
Returns() => voidCall this to remove the listener
// Register
const unsubscribe = receiveo.api.on('open', () => {
console.log('Chat window opened');
});
// Later, remove the listener
unsubscribe();

Identifies the current visitor as a known contact.

ParameterTypeDescription
data.emailstring?Contact email
data.namestring?Contact name
data.phonestring?Contact phone
data.customFieldsRecord<string, unknown>?Custom fields
data.externalIdstring?External system ID
data.externalIdProviderstring?External ID provider name
receiveo.api.identify({
name: 'Jane Smith',
customFields: {
plan: 'pro',
company: 'Acme Inc',
},
});

New

Returns true if the chat bubble is currently visible.

if (receiveo.api.isBubbleVisible) {
console.log('Bubble is showing');
}

New

Returns true if the chat window is currently open.

if (receiveo.api.isChatWindowOpen) {
console.log('Chat is open');
}

Register listeners with on().

Fires when the widget has fully initialized (both iframes loaded and ready).

receiveo.api.on('ready', () => {
console.log('Widget is ready');
});

Fires when the chat window opens.

receiveo.api.on('open', () => {
// Track in analytics, hide other UI, etc.
});

Fires when the chat window closes (for any reason — X button, Escape key, or api.close()).

receiveo.api.on('close', () => {
// Chat window was closed
});

Fires when the bubble becomes visible (via showBubble() or default load).

receiveo.api.on('bubble:show', () => {
// Bubble is now visible
});

Fires when the bubble is hidden (via hideBubble() or hideBubbleOnClose behavior).

receiveo.api.on('bubble:hide', () => {
// Bubble is now hidden
});