Android Configuration
LovinaChatConfig
The LovinaChatConfig class holds all configuration options for the chat widget.
val config = LovinaChatConfig(
websiteToken = "your-website-token",
baseUrl = "https://chat-prod.ailovina.com",
locale = "en",
colorScheme = "auto",
user = null,
theme = null,
branding = null,
texts = null,
features = null,
displayMode = "fullscreen"
)
Fields
| Parameter | Type | Default | Required | Description |
|---|---|---|---|---|
websiteToken | String | -- | Yes | Your Lovina website token for this agent. Obtained from the Lovina dashboard -- each agent has its own token. |
baseUrl | String | -- | Yes | Base URL of your Lovina instance (e.g., https://chat-prod.ailovina.com). |
locale | String | "id" | No | Widget locale code. Supported values include "id", "en", "ar". |
colorScheme | String | "auto" | No | Dark mode preference for the widget. Accepts "light", "dark", or "auto" (follows system theme). |
user | LovinaChatUser? | null | No | Pre-identified user to associate with the conversation. See below. |
theme | LovinaThemeConfig? | null | No | Theme color and layout overrides. Only primaryColor is required in practice -- see Theming. Colors are hex Strings, not ARGB Ints. |
branding | LovinaBrandingConfig? | null | No | White-label branding overrides (logo, brand name, "powered by" footer). |
texts | Map<String, Any?>? | null | No | UI string overrides, keyed by translation key. |
features | LovinaFeatureFlags? | null | No | Feature-flag overrides. |
displayMode | String | "fullscreen" | No | Widget 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-prod.ailovina.com",
theme = LovinaThemeConfig(
primaryColor = "#6366F1",
fontFamily = "Inter, sans-serif",
bubbleRadius = 16
),
branding = LovinaBrandingConfig(
brandName = "Acme Support",
poweredBy = false
)
)
LovinaChatUser
The LovinaChatUser class represents a pre-identified user.
| Parameter | Type | Required | Description |
|---|---|---|---|
identifier | String | Yes | Unique user ID in your system. |
name | String? | No | Display name. |
email | String? | No | Email address. |
phoneNumber | String? | No | Phone number (E.164 format recommended). |
identifierHash | String? | No | HMAC hash for identity verification. Generate server-side. |
customAttributes | Map<String, Any>? | No | Arbitrary key-value metadata attached to the contact. |
Example: Full Configuration
import com.lovina.chatsdk.*
val config = LovinaChatConfig(
websiteToken = "ws-tok-abc123",
baseUrl = "https://chat-prod.ailovina.com",
locale = "en",
colorScheme = "dark",
displayMode = "fullscreen",
theme = LovinaThemeConfig(
primaryColor = "#6366F1"
),
branding = LovinaBrandingConfig(
brandName = "Acme Support"
),
user = LovinaChatUser(
identifier = "user-12345",
name = "Jane Doe",
email = "jane@example.com",
phoneNumber = "+6281234567890",
identifierHash = "hmac-sha256-hash",
customAttributes = mapOf(
"plan" to "premium",
"signup_date" to "2025-01-15"
)
)
)
chatWidget.configure(config)