<eka-medassist-widget> element — or programmatically with EkaMedAssist.init().
HTML attributes
Your MedAssist agent identifier. The only required attribute.
Authentication token sent with the session.
Display title shown in the widget header.
Icon URL for the floating launcher button.
Base URL for the agent-config and nudge API endpoints.
widget shows a floating launcher button; full renders a fullscreen overlay.A JSON object of key-value context pairs, merged into the session at init. Example:
context='{"intent":"book_appointment"}'.A JSON theme object. See Theme object for the supported keys.
CSS injected into the launcher’s Shadow DOM to reposition or restyle the button. See Custom launcher styling.
Allow the user to resize the widget once it’s open.
URL to redirect to when the widget closes. Setting this automatically shows a close button.
Which backend environment the widget talks to. Also affects asset loading.
Real-time transport: Server-Sent Events or WebSocket. Usually inherited from agent config.
Theme object
Pass these keys inside thetheme attribute (as JSON) or the theme field of init(). Theme values you set here override what the console provides.
Primary accent color (hex). Drives buttons, accents, and the user message bubble.
Background image URL for the widget interior. Enables a glass-morphism treatment for the header and footer.
Text color override.
Theme mode. When
textColor is unset, it is derived from this (light → black text, dark → white text).Tint the header with the primary color.
Custom logo/title image URL shown in the header.
Tagline text shown beneath the title.
Display modes
- Widget (floating)
- Full (fullscreen)
A floating launcher button in the corner; the chat opens in a panel. This is the default.
Custom launcher styling
To reposition or restyle the floating button, pass CSS viacustom-launcher-styles (or customLauncherStyles in init()). The CSS is injected into the launcher’s Shadow DOM, so media queries, hover states, and any other CSS all work. Two selectors form a stable contract:
| Selector | Use it for |
|---|---|
:host | The launcher wrapper — position, bottom, right, left, top, transform, z-index. |
#medassist-open-btn | The button itself — size, background, box-shadow, border-radius. |
This only affects the launcher button. The chat panel that opens on click is unaffected.
What comes from the console vs. your code
The widget resolves config from three sources. Higher in this list wins:EkaMedAssist.init() config (highest priority)
Anything you pass programmatically overrides everything else.
Agent config (from the console)
Fetched from the backend for your
agentId. Overrides HTML attributes.name/title, allowed inputs (text, file, audio, voice), nudge, connectivity, initial_message, the full theme (background, accent, mode, title image, tagline, nudge color), and hide_watermark.
Client-only (never from the backend): auth, context (merged with any console context), customLauncherStyles, redirectUrl, and showCloseButton.
Next steps
JavaScript API
Configure all of the above programmatically and hook into the close event.

