Skip to main content

Configuration Reference

All configuration is set via window.lovinaSettings before calling window.lovinaChatSDK.run(). Settings are read once during initialization. To change settings at runtime, use the JavaScript API.

window.lovinaSettings = {
position: 'right',
displayMode: 'popup',
colorScheme: 'auto',
locale: 'en',
branding: { /* ... */ },
theme: { /* ... */ },
texts: { /* ... */ },
features: { /* ... */ },
};

Identity Verification (optional)​

note

Identity verification is enforced per channel in off, monitor, or required mode. See Enforcement Modes for what each mode does, and When Verification Happens for when the check runs.

Passed to window.lovinaChatSDK.run() directly -- not window.lovinaSettings -- since it's a signed credential rather than a display setting.

window.lovinaChatSDK.run({
baseUrl: 'https://chat.ailovina.com',
websiteToken: 'YOUR_TOKEN',
identity: {
mode: 'user',
userId: 'user-123',
exp: 1735689600,
sigHash: 'server-computed-hmac-hash',
},
});
OptionTypeDescription
mode'user'Identity mode. Only 'user' is available today.
userIdstringThe same user ID you pass to setUser().
expnumberUnix timestamp (seconds) after which the signature expires.
sigHashstringHMAC signature computed on your server -- never in the browser.

Compute sigHash on your server, HMAC-SHA256 over exp:userId using your channel's signing secret. See the User Identification guide for sample code in Java, Node.js, Python, PHP, Ruby, and Go.

warning

Never compute sigHash in client-side code -- your signing secret must stay on your server.

Omit identity only on an off channel -- see Enforcement Modes.

Display Settings​

OptionTypeDefaultDescription
position'left' | 'right''right'Which side of the screen the launcher bubble appears on.
displayMode'popup' | 'sidebar' | 'fullscreen''popup'How the chat panel renders. See Display Modes.
type'standard' | 'expanded''standard'Bubble style. 'standard' shows an icon only; 'expanded' shows an icon with text.
hideMessageBubblebooleanfalseWhen true, the launcher bubble is hidden. Use $lovina.toggle('open') to open programmatically.
launcherTitlestring''Text displayed next to the bubble icon when type is 'expanded'.
sidebarWidthnumberundefinedWidth in pixels when displayMode is 'sidebar'.
sidebarOverlaybooleanundefinedWhen true, sidebar overlays page content. When false, page content is pushed aside.

Appearance Settings​

OptionTypeDefaultDescription
colorScheme'light' | 'dark' | 'auto''light'Color scheme. 'auto' follows the user's OS preference.
localestring'id'BCP 47 locale code (e.g., 'en', 'id', 'pt-BR'). See Internationalization.
useBrowserLanguagebooleantrueAuto-detect locale from navigator.language. Overrides locale if a match is found.

Branding​

White-label configuration for replacing default assets and text. Set poweredBy: false for a fully white-labeled experience.

window.lovinaSettings = {
branding: {
brandName: 'Acme Support',
logoUrl: 'https://example.com/logo.svg',
bubbleIconUrl: 'https://example.com/bubble-icon.svg',
faviconUrl: 'https://example.com/favicon.ico',
poweredBy: false,
},
};
OptionTypeDefaultDescription
brandNamestringundefinedName displayed in the chat header (e.g., 'Acme Support').
logoUrlstringundefinedURL to a custom logo image shown in the chat header.
bubbleIconUrlstringundefinedURL to a custom icon for the launcher bubble. Should be SVG or PNG, 24x24 or 32x32 px with transparent background.
faviconUrlstringundefinedURL to a custom favicon used in the popout chat window.
poweredBybooleantrueShow the "Powered by Lovina" footer. Set to false for full white-label.

Theme​

Customize the widget's visual appearance. Only primaryColor is required -- all other colors are automatically generated using an algorithm that ensures WCAG AA contrast compliance (4.5:1 minimum ratio).

window.lovinaSettings = {
theme: {
primaryColor: '#6366F1',
},
};

How Auto-Generation Works​

When you set only primaryColor, the SDK converts your color to HSL, determines whether it is light or dark, and generates complementary background, text, bubble, and border colors -- all checked against WCAG AA contrast requirements.

Full Theme Options​

OptionTypeDefaultDescription
primaryColorstringundefinedPrimary brand color for user bubbles, buttons, and accents.
primaryTextColorstringautoText color on primary-colored surfaces.
backgroundColorstringautoChat panel background color.
agentBubbleColorstringautoBackground color of agent message bubbles.
agentBubbleTextColorstringautoText color inside agent message bubbles.
userBubbleColorstringautoBackground of user message bubbles. Defaults to primaryColor.
userBubbleTextColorstringautoText color inside user message bubbles.
textColorstringautoMain body text color.
secondaryTextColorstringautoSecondary/muted text color (timestamps, hints).
inputColorstringautoInput field background color.
borderColorstringautoBorder color for cards, inputs, and dividers.
fontFamilystringsystem defaultCSS font-family (e.g., 'Inter, sans-serif').
fontSizenumber14Base font size in pixels.
borderRadiusnumberundefinedBorder radius in pixels for cards and panels.
bubbleRadiusnumberundefinedBorder radius in pixels for message bubbles.
buttonRadiusnumberundefinedBorder radius in pixels for buttons.
bubbleSizenumber64Launcher bubble diameter in pixels.
bubbleColorstringprimaryColorLauncher bubble background color.
bubbleIconColorstringautoLauncher bubble icon color.
bubbleShadowbooleantrueShow a drop shadow on the launcher bubble.

Feature Flags​

Feature flags control which widget capabilities are enabled. All default to sensible values. Override only the ones you need.

window.lovinaSettings = {
features: {
enable_file_upload: true,
enable_emoji_picker: true,
enable_sound_notification: true,
},
};

Transport Flags​

FlagDefaultDescription
enable_websockettrueEnable WebSocket transport (preferred, fastest).
enable_ssetrueEnable Server-Sent Events transport (fallback).
enable_long_pollingtrueEnable long-polling transport (final fallback).

UI Flags​

FlagDefaultDescription
enable_voice_inputtrueShow voice input button in the composer.
enable_emoji_pickerfalseShow emoji picker button in the composer.
enable_file_uploadtrueAllow file and image uploads.
enable_typing_indicatortrueShow typing indicator when the agent is composing.
enable_read_receiptstrueShow read receipt indicators on messages.
enable_prechat_formfalseShow a pre-chat form before starting a conversation.
enable_end_conversationtrueAllow the user to end/resolve the conversation.
enable_popout_windowfalseShow a button to pop out chat into a standalone window.
enable_sound_notificationtruePlay a sound when a new message arrives.

Display Flags​

FlagDefaultDescription
enable_sidebar_modetrueAllow the widget to render in sidebar mode.
enable_conversation_historytrueShow list of past conversations.
enable_new_conversationtrueAllow starting a new conversation.
enable_dark_modetrueAllow toggling dark mode within the widget.
enable_unread_badgetrueShow unread message count badge on the bubble.

Advanced Flags​

FlagDefaultDescription
enable_campaignsfalseEnable proactive campaign messages.
enable_csatfalseEnable customer satisfaction surveys.
enable_analytics_eventstrueEmit analytics events for tracking widget usage.
debug_modefalseEnable debug logging to the browser console.

Feature flags are merged in a 3-layer strategy: server defaults, SDK defaults, then your client overrides (highest priority).

Text Overrides​

Override any default UI string by providing a nested object matching the translation key structure. Overrides take priority over locale-specific translations.

window.lovinaSettings = {
texts: {
welcome: {
title: 'Welcome to Acme!',
message: 'How can our team help you today?',
},
input: {
placeholder: 'Type your question here...',
},
header: {
title: 'Acme Help Desk',
},
},
};

See the Internationalization guide for the full list of translation keys.

Complete Example​

window.lovinaSettings = {
position: 'right',
displayMode: 'popup',
type: 'expanded',
launcherTitle: 'Chat with us',
colorScheme: 'auto',
locale: 'en',
branding: {
brandName: 'Acme Support',
logoUrl: 'https://example.com/logo.svg',
poweredBy: false,
},
theme: {
primaryColor: '#6366F1',
fontFamily: 'Inter, system-ui, sans-serif',
borderRadius: 16,
bubbleSize: 60,
},
texts: {
welcome: {
title: 'Hi there!',
message: 'How can we help?',
},
},
features: {
enable_file_upload: true,
enable_emoji_picker: true,
enable_sound_notification: true,
debug_mode: false,
},
};