Skip to main content

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.

AttributeRequiredMaps to
data-oxvo-base-urlYesbaseUrl
data-oxvo-website-tokenYeswebsiteToken
data-oxvo-localeNosettings.locale
data-oxvo-positionNosettings.position (left or right)
data-oxvo-themeNosettings.theme (light, dark, auto)
data-oxvo-launcher-titleNosettings.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:

KeyTypePurpose
baseDomainstringCookie domain override for shared subdomains
useBrowserLanguagebooleanUse browser locale instead of fixed locale
localestringInitial 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
launcherTitlestringLauncher label text
launcherVisiblebooleanInitial launcher visibility
showPopoutButtonbooleanShow popout button
showUnreadMessagesDialogbooleanShow unread dialog behavior
welcomeTitlestringWelcome heading text
welcomeDescriptionstringWelcome description text
availableMessagestringOnline state message
unavailableMessagestringOffline state message
enableFileUploadbooleanAllow attachments
enableEmojiPickerbooleanAllow emoji picker
enableEndConversationbooleanAllow end-conversation action
enableGifPickerbooleanAllow GIF picker
headerTextColorstringHeader text color override
headerDecorationModenumberHeader decoration mode
tabSpacesstring[]Tabs shown in launcher/home
convStartersarrayConversation starters
convLinksarrayHome links
homeBlocksOrderstring[]Home block order
avatarUrlstringLauncher avatar URL
helpCenterSlugstringLinked help center slug
preChatFormEnabledbooleanToggle pre-chat form
preChatFormOptionsobjectPre-chat form config
appsarrayApp shortcuts in launcher

Use runtime methods like setLocale, setTheme, and setLauncherVisible for changes after initialization.

Core lifecycle

MethodPurpose
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

MethodPurpose
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

MethodPurpose
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

MethodPurpose
setLocale(locale)Update runtime locale
`setTheme('light''dark'
setColorScheme(...)Alias of setTheme

Loader and configuration (React/Vue controller)

MethodPurpose
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

MethodPurpose
on(eventKey, handler)Subscribe listener
off(eventKey, handler)Unsubscribe listener
once(eventKey, handler)Subscribe once
eventsEvent 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);
}

📷 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."