Skip to main content

Android Configuration

LovinaChatConfig​

The LovinaChatConfig class holds all configuration options for the chat widget.

val config = LovinaChatConfig(
websiteToken = "your-website-token",
baseUrl = "https://chat.ailovina.com",
locale = "en",
colorScheme = "auto",
user = null,
theme = null,
branding = null,
texts = null,
features = null,
displayMode = "fullscreen"
)

Fields​

ParameterTypeDefaultRequiredDescription
websiteTokenString--YesYour Lovina website token for this agent. Obtained from the Lovina dashboard -- each agent has its own token.
baseUrlString--YesBase URL of your Lovina instance (e.g., https://chat.ailovina.com).
localeString"id"NoWidget locale code. Supported values include "id", "en", "ar".
colorSchemeString"auto"NoDark mode preference for the widget. Accepts "light", "dark", or "auto" (follows system theme).
userLovinaChatUser?nullNoPre-identified user to associate with the conversation. See below.
identityLovinaChatIdentity?nullNoSigned identity proof (HMAC) verifying the session's user. See Identity Verification.
themeLovinaThemeConfig?nullNoTheme color and layout overrides. Only primaryColor is required in practice -- see Theming. Colors are hex Strings, not ARGB Ints.
brandingLovinaBrandingConfig?nullNoWhite-label branding overrides (logo, brand name, "powered by" footer).
textsMap<String, Any?>?nullNoUI string overrides, keyed by translation key.
featuresLovinaFeatureFlags?nullNoFeature-flag overrides. See File Uploads.
displayModeString"fullscreen"NoWidget display mode. Accepts "popup", "sidebar", or "fullscreen".

Theming​

Only LovinaThemeConfig.primaryColor is required in practice -- every other color is auto-generated by the widget to meet WCAG AA contrast. Colors are hex strings (e.g. "#6366F1"), not Color ints:

LovinaChatConfig(
websiteToken = "your-website-token",
baseUrl = "https://chat.ailovina.com",
theme = LovinaThemeConfig(
primaryColor = "#6366F1",
fontFamily = "Inter, sans-serif",
bubbleRadius = 16
),
branding = LovinaBrandingConfig(
brandName = "Acme Support",
poweredBy = false
)
)

Identity Verification (optional)​

identity proves a session belongs to a specific user with a server-signed HMAC:

val config = LovinaChatConfig(
websiteToken = "YOUR_TOKEN",
baseUrl = "https://chat.ailovina.com",
identity = LovinaChatIdentity(
userId = "user-123",
exp = 1735689600L,
sigHash = "server-computed-hmac-hash"
)
)
OptionTypeDescription
modeStringIdentity mode. Always "user" (the default).
userIdStringThe same user ID you pass as identifier in LovinaChatUser.
expLongUnix timestamp (seconds) after which sigHash expires.
sigHashStringHMAC signature computed on your server -- never in the app.

See the User Identification guide for how to compute sigHash.

LovinaChatUser​

The LovinaChatUser class represents a pre-identified user.

ParameterTypeRequiredDescription
identifierStringYesUnique user ID in your system.
nameString?NoDisplay name.
emailString?NoEmail address.
phoneNumberString?NoPhone number (E.164 format recommended).
customAttributesMap<String, Any>?NoArbitrary key-value metadata attached to the contact.

File Uploads​

File uploads are disabled by default. Enable the composer's attach button with:

LovinaChatConfig(
websiteToken = "your-website-token",
baseUrl = "https://chat.ailovina.com",
features = LovinaFeatureFlags(enableFileUpload = true)
)

The button only appears if the SDK can confirm your host Activity supports opening the system file picker — in the rare case it can't, the button stays hidden even with this flag enabled. The SDK logs why, and emits ChatEvent.Error(code = "file_upload_unavailable") through onEvent. Set onEvent before calling configure() to receive it — see the class doc on onEvent. This notification fires at most once per widget instance, not on every reload().

Example: Full Configuration​

import com.lovina.chatsdk.*

val config = LovinaChatConfig(
websiteToken = "lvk_live_xxxx",
baseUrl = "https://chat.ailovina.com",
locale = "en",
colorScheme = "dark",
displayMode = "fullscreen",
theme = LovinaThemeConfig(
primaryColor = "#6366F1"
),
branding = LovinaBrandingConfig(
brandName = "Acme Support"
),
identity = LovinaChatIdentity(
userId = "user-12345",
exp = 1735689600L,
sigHash = "server-computed-hmac-hash"
),
user = LovinaChatUser(
identifier = "user-12345",
name = "Jane Doe",
email = "jane@example.com",
phoneNumber = "+6281234567890",
customAttributes = mapOf(
"plan" to "premium",
"signup_date" to "2025-01-15"
)
)
)

chatWidget.configure(config)