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.lovina.app",
locale = "en",
colorScheme = "auto",
user = null,
customColor = null,
displayMode = "fullscreen"
)

Fields

ParameterTypeDefaultRequiredDescription
websiteTokenString--YesYour Lovina website channel token. Obtained from the Lovina dashboard.
baseUrlString--YesBase URL of your Lovina instance (e.g., https://chat.lovina.app).
localeString"id"NoWidget locale code. Supported values include "id", "en", "ar".
colorSchemeString"auto"NoColor scheme for the widget. Accepts "light", "dark", or "auto" (follows system theme).
userLovinaChatUser?nullNoPre-identified user to associate with the conversation. See below.
customColorInt?nullNoARGB color integer for header and bubble theming. Use Color.parseColor("#HEX") to convert.
displayModeString"fullscreen"NoWidget display mode. Accepts "popup", "sidebar", or "fullscreen".

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).
identifierHashString?NoHMAC hash for identity verification. Generate server-side.
customAttributesMap<String, Any>?NoArbitrary key-value metadata attached to the contact.

Example: Full Configuration

import android.graphics.Color
import com.lovina.chatsdk.*

val config = LovinaChatConfig(
websiteToken = "ws-tok-abc123",
baseUrl = "https://chat.lovina.app",
locale = "en",
colorScheme = "dark",
displayMode = "fullscreen",
customColor = Color.parseColor("#6366F1"),
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)