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

Tracks a custom event for proactive message triggers. Only events matching a configured custom_event trigger are forwarded — all others are silently dropped (no overhead).

ParameterTypeDescription
eventNamestringThe event name to track (must match a proactive message trigger’s event field)
metadataRecord<string, unknown>?Optional metadata (reserved for future use)
// Track when a visitor views the pricing table
receiveo.api.track('viewed-pricing-table');
// Track with metadata
receiveo.api.track('added-to-cart', { product: 'pro-plan', value: 49 });

New

Returns the list of proactive message configs loaded from your workspace settings.

ReturnsTypeDescription
Array<{ id, content, engagementMessage, priority }>Copy of the proactive message configs
const messages = receiveo.api.getProactiveMessages();
console.log(messages);
// [
// { id: "pm-abc123", content: "Need help choosing a plan?", engagementMessage: "Let me help...", priority: 10 },
// { id: "pm-def456", content: "Welcome back!", engagementMessage: "How can I help today?", priority: 5 },
// ]

New

Manually triggers a specific proactive message by ID, bypassing all trigger and frequency rules. Useful for custom integrations where you want full control over when a CTA appears.

ParameterTypeDescription
idstringThe proactive message ID (from getProactiveMessages())
// Show a specific CTA when a visitor reaches a certain step
receiveo.api.showProactiveMessage('pm-abc123');

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
});