SiteConfig

@Serializable(with = SiteConfig.Serializer::class)
data class SiteConfig(val siteId: String = "", val name: String = "", val color: String = "#0ea5e9", val position: String = "right", val localeDefault: String = "auto", val greeting: Map<String, String> = emptyMap(), val awayMessage: Map<String, String> = emptyMap(), val offlineCapture: OfflineCapture = OfflineCapture.OFF, val hideWhenOffline: Boolean = false, val theme: SiteTheme = SiteTheme.AUTO, val botEnabled: Boolean = false, val agentAvatars: List<AgentAvatar> = emptyList(), val launcher: LauncherConfig = LauncherConfig(), val header: HeaderConfig? = null, val greetingOptions: GreetingOptions? = null, val contactButtons: List<ContactButton> = emptyList(), val raw: JsonObject = EmptyJsonObject)

Site settings the widget and SDK render from.

Constructors

Link copied to clipboard
constructor(siteId: String = "", name: String = "", color: String = "#0ea5e9", position: String = "right", localeDefault: String = "auto", greeting: Map<String, String> = emptyMap(), awayMessage: Map<String, String> = emptyMap(), offlineCapture: OfflineCapture = OfflineCapture.OFF, hideWhenOffline: Boolean = false, theme: SiteTheme = SiteTheme.AUTO, botEnabled: Boolean = false, agentAvatars: List<AgentAvatar> = emptyList(), launcher: LauncherConfig = LauncherConfig(), header: HeaderConfig? = null, greetingOptions: GreetingOptions? = null, contactButtons: List<ContactButton> = emptyList(), raw: JsonObject = EmptyJsonObject)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
@Serializable(with = AgentAvatarListSerializer::class)
@SerialName(value = "agent_avatars")
val agentAvatars: List<AgentAvatar>

Online team members for the header (and the greeting's signature).

Link copied to clipboard
@Serializable(with = LenientStringMapSerializer::class)
@SerialName(value = "away_message")
val awayMessage: Map<String, String>

Away message per locale, shown while nobody is online.

Link copied to clipboard
@SerialName(value = "bot_enabled")
val botEnabled: Boolean = false

The AI assistant answers first.

Link copied to clipboard

Accent colour as #rrggbb.

Link copied to clipboard
@SerialName(value = "contact_buttons")
val contactButtons: List<ContactButton>

Other ways to reach the shop (Zalo, Messenger, phone, email).

Link copied to clipboard

Greeting per locale, shown when the conversation is empty.

Link copied to clipboard
@SerialName(value = "greeting_options")
val greetingOptions: GreetingOptions? = null

Greeting display options (older gateways: null, the greeting always shows).

Link copied to clipboard
val header: HeaderConfig? = null

Header subtitle, logo and profile (older gateways: null, the agents' initials and no subtitle).

Link copied to clipboard
@SerialName(value = "hide_when_offline")
val hideWhenOffline: Boolean = false

Hide the launcher while offline (web).

Link copied to clipboard

How the launcher button looks (older gateways: the default chat bubble).

Link copied to clipboard
@SerialName(value = "locale_default")
val localeDefault: String

vi, en or auto.

Link copied to clipboard

Site (business) name shown in the header.

Link copied to clipboard
@SerialName(value = "offline_capture")
val offlineCapture: OfflineCapture

Pre-chat form policy.

Link copied to clipboard

Launcher position on the web (left / right).

Link copied to clipboard
@Transient
val raw: JsonObject

The full wire payload (campaigns, social proof, ...).

Link copied to clipboard
@SerialName(value = "site_id")
val siteId: String

Site id.

Link copied to clipboard

Preferred colour scheme.

Functions

Link copied to clipboard

Away message for locale, falling back to the other language.

Link copied to clipboard

Greeting for locale, falling back to the other language.

Link copied to clipboard
fun toJson(): JsonObject

The wire shape (unknown fields from raw kept).