-
public final class EmilyChatOptionsConfiguration passed to EmilyChat.configure. Mirrors the JS
EmilyInitOptionsshape — the bridge serializes this straight into theINIT.payloadobject the web SDK consumes.EmilyChat.configure( EmilyChatOptions( serviceSid = "LV3-...", locale = "zh-Hans", metadata = mapOf("plan" to "pro", "tenantId" to 42), ) )Note: there is no visual/branding option here. The widget's appearance (brand color, theme, header title, logos…) comes from the tenant's chat configuration on the Level3AI server, fetched by the web bundle at boot — nothing for the host app to pass.
Note: metadata and attributes must contain only JSON-compatible values (
String,Boolean, numeric types,null, orMap/List/org.json.JSONObject/org.json.JSONArrayof the same). Non-JSON values surface as an EmilyChatEvent.BridgeError at open-time rather than crashing.
-
-
Field Summary
Fields Modifier and Type Field Description private final StringserviceSidprivate final StringuserTokenprivate final Stringlocaleprivate final Map<String, Object>metadataprivate final Map<String, Object>attributesprivate final EmilyChatEnvironmentenvironment
-
Constructor Summary
Constructors Constructor Description EmilyChatOptions(String serviceSid, String userToken, String locale, Map<String, Object> metadata, Map<String, Object> attributes, EmilyChatEnvironment environment)EmilyChatOptions(String serviceSid, String userToken, String locale, Map<String, Object> metadata, Map<String, Object> attributes)EmilyChatOptions(String serviceSid, String userToken, String locale, Map<String, Object> metadata)EmilyChatOptions(String serviceSid, String userToken, String locale)EmilyChatOptions(String serviceSid, String userToken)EmilyChatOptions(String serviceSid)
-
Method Summary
Modifier and Type Method Description final StringgetServiceSid()The Emily service identifier issued to your tenant. final StringgetUserToken()Opaque end-user token used by the backend to identify / authenticate the conversation owner. final StringgetLocale()BCP-47 language tag (e.g. final Map<String, Object>getMetadata()Free-form key/value bag forwarded to the backend on every message. final Map<String, Object>getAttributes()User-attribute map (name, email, avatarUrl, customFields…). final EmilyChatEnvironmentgetEnvironment()Environment / CDN the WebView should load. -
-
Constructor Detail
-
EmilyChatOptions
EmilyChatOptions(String serviceSid, String userToken, String locale, Map<String, Object> metadata, Map<String, Object> attributes, EmilyChatEnvironment environment)
-
EmilyChatOptions
EmilyChatOptions(String serviceSid, String userToken, String locale, Map<String, Object> metadata, Map<String, Object> attributes)
-
EmilyChatOptions
EmilyChatOptions(String serviceSid, String userToken, String locale, Map<String, Object> metadata)
-
EmilyChatOptions
EmilyChatOptions(String serviceSid)
-
-
Method Detail
-
getServiceSid
final String getServiceSid()
The Emily service identifier issued to your tenant. Required.
-
getUserToken
final String getUserToken()
Opaque end-user token used by the backend to identify / authenticate the conversation owner. Optional for anonymous chats.
-
getMetadata
final Map<String, Object> getMetadata()
Free-form key/value bag forwarded to the backend on every message. Must be JSON-safe.
-
getAttributes
final Map<String, Object> getAttributes()
User-attribute map (name, email, avatarUrl, customFields…). Merged flat into the conversation's attributes — the same shape the web SDK's
Emily.setAttributes()takes, so App and browser integrations land identical data on the backend. Keys that collide with Emily's own init options (serviceSid,userToken,locale,metadata,style,showLauncher,fullscreen) are dropped and reported as an EmilyChatEvent.BridgeError with stage"init.attributes". Must be JSON-safe.
-
getEnvironment
final EmilyChatEnvironment getEnvironment()
Environment / CDN the WebView should load. Defaults to EmilyChatEnvironment.Production.
-
-
-
-