Methods reference
This page is the operational method index for Messenger SDK integrations.
What it is
The Messenger SDK exposes a unified API surface for:
- Loading and lifecycle control
- Bootstrap configuration
- Launcher behavior
- Identity and attributes
- Theme and locale updates
- Event subscription
Where to find it in OXVO
Method calls run in your app code. Their effect is visible in Messenger runtime and Inbox conversations.
When to use it
Use this page while implementing or reviewing SDK integration code paths.
Bootstrap configuration (Plain HTML script)
Script tag attributes (auto-init parser)
sdk.js auto-init reads this <script> tag and parses the attributes below.
| Attribute | Required | Maps to |
|---|---|---|
data-oxvo-base-url | Yes | baseUrl |
data-oxvo-website-token | Yes | websiteToken |
data-oxvo-locale | No | settings.locale |
data-oxvo-position | No | settings.position (left or right) |
data-oxvo-theme | No | settings.theme (light, dark, auto) |
data-oxvo-launcher-title | No | settings.launcherTitle |
Note: For auto-init, these are the only optional
data-oxvo-*attributes parsed from the script tag.
Additional startup settings
For more startup options, use window.oxvoSettings before loading sdk.js, or pass settings to window.oxvo.init(...).
<script>
window.oxvoSettings = {
launcherVisible: true,
widgetStyle: 'flat',
type: 'expanded_bubble',
showPopoutButton: true,
useBrowserLanguage: true,
welcomeTitle: 'Support',
welcomeDescription: 'Ask us anything',
};
</script>
Supported startup settings:
| Key | Type | Purpose |
|---|---|---|
baseDomain | string | Cookie domain override for shared subdomains |
useBrowserLanguage | boolean | Use browser locale instead of fixed locale |
locale | string | Initial locale |
position | 'left' | 'right' | Launcher side |
theme | 'light' | 'dark' | 'auto' | Initial theme |
widgetStyle | 'standard' | 'flat' | Launcher visual style |
type | 'standard' | 'expanded' | 'expanded_bubble' | Launcher type |
launcherTitle | string | Launcher label text |
launcherVisible | boolean | Initial launcher visibility |
showPopoutButton | boolean | Show popout button |
showUnreadMessagesDialog | boolean | Show unread dialog behavior |
welcomeTitle | string | Welcome heading text |
welcomeDescription | string | Welcome description text |
availableMessage | string | Online state message |
unavailableMessage | string | Offline state message |
enableFileUpload | boolean | Allow attachments |
enableEmojiPicker | boolean | Allow emoji picker |
enableEndConversation | boolean | Allow end-conversation action |
enableGifPicker | boolean | Allow GIF picker |
headerTextColor | string | Header text color override |
headerDecorationMode | number | Header decoration mode |
tabSpaces | string[] | Tabs shown in launcher/home |
convStarters | array | Conversation starters |
convLinks | array | Home links |
homeBlocksOrder | string[] | Home block order |
avatarUrl | string | Launcher avatar URL |
helpCenterSlug | string | Linked help center slug |
preChatFormEnabled | boolean | Toggle pre-chat form |
preChatFormOptions | object | Pre-chat form config |
apps | array | App shortcuts in launcher |
Use runtime methods like setLocale, setTheme, and setLauncherVisible for changes after initialization.
Core lifecycle
| Method | Purpose |
|---|---|
init({ baseUrl, websiteToken, settings }) | Initialize plain-script window.oxvo client |
load({ open?: boolean }) | Load SDK runtime and initialize client |
ready() | Resolve when Messenger is ready |
open() | Open Messenger |
close() | Close Messenger |
toggle() / `toggle('open' | 'close')` |
reset() | Reset local messenger session and identity state |
load(...) is used by React/Vue SDK controllers. Plain HTML script integrations initialize through script auto-init or window.oxvo.init(...).
Launcher and window controls
| Method | Purpose |
|---|---|
showLauncher() | Show launcher |
hideLauncher() | Hide launcher |
setLauncherVisible(boolean) | Explicit launcher visibility |
| `toggleBubbleVisibility('show' | 'hide')` |
openPopout() | Open popout window |
popoutChatWindow() | Alias for popout behavior |
Identity and attributes
| Method | Purpose |
|---|---|
identify(id, profile) | Set authenticated user identity |
setUser(id, profile) | Alias of identify |
setAttributes(object) | Set contact custom attributes |
setCustomAttributes(object) | Alias of setAttributes |
removeAttribute(key) | Remove contact attribute |
deleteCustomAttribute(key) | Alias of removeAttribute |
setConversationAttributes(object) | Set conversation attributes |
setConversationCustomAttributes(object) | Alias of setConversationAttributes |
removeConversationAttribute(key) | Remove conversation attribute |
deleteConversationCustomAttribute(key) | Alias of removeConversationAttribute |
addLabel(label) | Add label to conversation context |
setLabel(label) | Alias of addLabel |
removeLabel(label) | Remove label |
Locale and theme
| Method | Purpose |
|---|---|
setLocale(locale) | Update runtime locale |
| `setTheme('light' | 'dark' |
setColorScheme(...) | Alias of setTheme |
Loader and configuration (React/Vue controller)
| Method | Purpose |
|---|---|
configure(options) | Update controller options after initialization |
setLiveChatLoader(configOrBoolean) | Update live chat loader mode and appearance |
scheduleLazyLoad() | Trigger lazy scheduling flow |
cancelLazyLoad() | Cancel pending lazy schedule |
Events API
| Method | Purpose |
|---|---|
on(eventKey, handler) | Subscribe listener |
off(eventKey, handler) | Unsubscribe listener |
once(eventKey, handler) | Subscribe once |
events | Event name map (oxvo:*) |
Example: minimal control panel
await messenger.load();
await messenger.identify('USER_42', {
name: 'Jane Doe',
email: 'jane@example.com',
identifier_hash: 'SERVER_GENERATED_HASH',
});
await messenger.setAttributes({ plan: 'pro' });
await messenger.setConversationAttributes({ checkout_step: 'payment' });
await messenger.setTheme('dark');
await messenger.open();
Error handling pattern
try {
await messenger.open();
} catch (error) {
console.error('OXVO Messenger open failed', error);
}
Related guides
- Install the Messenger SDK
- Visitor identification and properties
- Listeners and events
- Performance and security
📷 Image (optional): Messenger SDK method map by capability
Why: Helps engineers quickly locate the correct method family during implementation and review.
File:docs/images/sdk-method-reference-map.png
AI prompt: "Documentation-style matrix for OXVO Messenger SDK methods grouped by Lifecycle, Launcher, Identity, Attributes, Theme/Locale, and Events, with short examples and clean UI cards; modern SaaS look, neutral tones, high contrast text, OXVO branding only, 1600x1000."