Skip to main content

Interface: EmbedOptions

Options for BabelconnectEmbed.mount.

Properties

className?

optional className: string;

Optional className for the iframe.


container

container: HTMLElement;

Element the iframe is appended to.


context?

optional context: Record<string, unknown>;

Optional initial shared context (also settable later via context).


eventsVersion?

optional eventsVersion: string;

The agent.loaded/user.loaded event-payload schema version. Omit for the current app default ("v3"): agent.loaded carries {agentId} and user.loaded has no payload. The legacy adapter normalizes both to {agentId}. Pass "v1" to opt into the legacy shape used by the previous embedded phone widget (agent.loaded{agentId, agent:{id,name,email,number}}, user.loaded{agentId, user:{email}}) for a host still matching CRM users by email or routing by number. See the Embedding guide, "Loaded event schema version".


instanceId?

optional instanceId: string;

This mount's identity, echoed by the app on every app→host envelope ({type:"bcConnect", name, data, instanceId}) and reported as BabelconnectEmbed.instanceId. Omit it and one is generated per mount. Supply your own when you want the id to mean something in your own system (a CRM tab id, a workspace id) — it is correlation only and grants nothing; trust still rests on the origin allowlist and the token.

This is what lets a host with the app open in several browser tabs tell WHICH tab holds a live call — see "Multiple tabs and multiple embeds" in the Embedding guide, and cti.call's ownsMedia / the call.media_owner event. Max 128 characters; a longer one is ignored by the app in favour of a generated id.


legacyAuth?

optional legacyAuth: LegacyAuth;

Required in legacy mode; the host supplies the legacy app's credential handoff.


legacyBridge?

optional legacyBridge: true | LegacyBridge;

Set to true to use the bundled legacy iframe bridge, or inject a lifecycle-capable bridge. The v2 facade delegates host commands and app events to this bridge instead of using the modern postMessage client. Requires legacyAuth; point serverUrl and path at the legacy app. Omit to use the current app protocol.


path?

optional path: string;

Path within the app (default /).


serverUrl

serverUrl: string;

App origin (the iframe src + the only origin the legacy bridge exchanges messages with).


session?

optional session: Record<string, unknown>;

Optional initial session correlation (also settable later via session).


theme?

optional theme: EmbedTheme;

Optional brand tokens for the embedded app — your colours, your name, your logo (also settable later via BabelconnectEmbed.app's setTheme). See EmbedTheme. Legacy mode rejects this option with UnsupportedEmbedFeatureError.


token

token: string;

Bearer token, handed to the app via the active bridge after readiness (never in the URL).