-
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classEmilyChatOptions.Companion
-
Field Summary
Fields Modifier and Type Field Description private final StringresolvedContainerUrlprivate final StringserviceSidprivate final StringuserTokenprivate final Stringlocaleprivate final Map<String, Object>metadataprivate final Map<String, Object>attributesprivate final StringcontainerUrl
-
Constructor Summary
Constructors Constructor Description EmilyChatOptions(String serviceSid, String userToken, String locale, Map<String, Object> metadata, Map<String, Object> attributes, String containerUrl)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 StringgetResolvedContainerUrl()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 StringgetContainerUrl()Overrides the container page the WebView loads. -
-
Constructor Detail
-
EmilyChatOptions
EmilyChatOptions(String serviceSid, String userToken, String locale, Map<String, Object> metadata, Map<String, Object> attributes, String containerUrl)
-
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
-
getResolvedContainerUrl
final String getResolvedContainerUrl()
-
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.
-
getContainerUrl
final String getContainerUrl()
Overrides the container page the WebView loads. Default (
null) is the sid-routed CDN —https://sdk.lv3.ai/native/mobile.html?sid=<serviceSid>— where thesidquery drives the CloudFront edge router: it picks the tenant's environment and any server-side version pin, the exact same contract as the web embed'ssdk.lv3.ai/emily.js?sid=…script URL. So there is nothing to configure per environment; the sid decides.Set this only for local development (e.g.
"http://10.0.2.2:5174/mobile.html"againstyarn preview:mobile, which additionally needs a cleartext opt-in — see the README) or an on-prem deployment. A custom URL is loaded verbatim — nosidis appended. If you append your own?sid=, it only routes the bundle; the widget's configuration sid still comes from this class via the bridge INIT payload.
-
-
-
-