Key features
- Microphone selection: users can choose from available audio input devices
- Recording controls: start, pause, resume, and stop a consultation recording
- Real-time waveform visualization: animated audio level display during recording
- Theme customization: configure colors, border radius, and font to match your application
- Multi-language support: set the interface and speech recognition language independently
- Template support: route output through a predefined template for structured summaries
- Event system: react to widget lifecycle and summary delivery events
Basic usage
1
Add the container element
Add a
div in your HTML where the widget will render. Set explicit dimensions so the widget has space to display.2
Initialize the SDK
Load the Squire SDK from the CDN and create a
Squire instance with your access token and output language. See Authentication for how to obtain a token.3
Mount the widget
Call
mountWidget with the container selector and the widget name 'ai-consultation'. Pass a configuration object as the optional third argument to customize behavior and appearance.4
Listen for events
Subscribe to events on the returned widget instance. The
summary-ready event fires with intermediate results first and again with the final summary.Configuration options
Pass a configuration object as the third argument tomountWidget to customize the widget.
string
default:"outputLanguage from SDK initialization"
Language code for the widget interface and speech recognition input. Supported values:
'en' (English), 'nl' (Dutch), 'fr' (French), 'de' (German).When omitted, the widget uses the outputLanguage set during SDK initialization.string
default:"undefined (uses default template)"
Template ID for structured output generation. Templates define the sections and format of the consultation summary. See the templates documentation for available options.
ThemeConfig
Theme configuration object for customizing the widget’s visual appearance.
Events
Listen for events using theon method on the widget instance.
() => void
Emitted when the widget has fully loaded and is ready for user interaction.
(summary: ConsultationSummary) => void
Emitted when a consultation summary is available. This event fires multiple times:
- Once with intermediate results, where
summary.report_statusis'intermediate' - Once with the completed summary, where
summary.report_statusis'final'
The
summary-ready event fires more than once per consultation. Always check summary.report_status before writing data to your EHR system.Complete example
The following example shows a full HTML page embedding the AI Consultation Widget with theme customization and event handling.index.html