Skip to main content
Once the loader script has run, it exposes a global window.EkaMedAssist object. Use it to set or override configuration before the user opens the widget — handy when your values are dynamic (a logged-in user’s auth token, runtime context, etc.).

EkaMedAssist.init()

Call init() with a config object. Values passed here take precedence over both the agent config and any HTML attributes.

Config options

These are the camelCase equivalents of the HTML attributes, plus a couple of init-only fields.
string
Your MedAssist agent identifier.
string
Authentication token sent with the session.
string
Alternative auth header / bearer token.
string
Widget header title.
string
Launcher button icon URL.
string
Base URL for the agent-config and nudge endpoints.
"full" | "widget"
Fullscreen overlay or floating launcher.
Record<string, unknown>
Context object merged into the session. Merged with any context set via the HTML attribute, not replaced.
string
CSS injected into the launcher Shadow DOM. See Custom launcher styling.
string
URL to redirect to when the widget closes.
boolean
Allow the widget to be resized when open.
boolean
default:"false"
Force-show the close button. (Automatically shown when redirectUrl is set.)
object
Theme overrides — backgroundImage, primary, textColor, mode, headerTinted, titleImg, tagline. See Theme object.

onClose callback

Run code when the user closes the widget — for analytics, cleanup, or your own navigation:

Self-hosting widget assets

By default, the loader fetches the widget’s JS and CSS from the CDN on first open. To serve your own build, point the loader at your asset directory with the data-widget-assets attribute on the script tag:
Ensure medassist-widget.js and medassist-widget.css are served at that path.
If you’re building a fully custom interface rather than configuring the prebuilt widget, drop down to the Core SDK.