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
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.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.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.Configuration options
Pass a configuration object as the third argument tomountWidget to customize the widget.
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.Template ID for structured output generation. Templates define the sections and format of the consultation summary. See the templates documentation for available options.
Theme configuration object for customizing the widget’s visual appearance.
| Property | Type | Description |
|---|---|---|
colorPrimary | string | Primary color for buttons and accents. |
colorDark | string | Dark color for text and borders. |
colorLight | string | Light accent color for hover states. |
colorLightest | string | Lightest color for backgrounds. |
borderRadius | string | Border radius for UI elements. |
font | string | Font family. All Google Fonts are supported. |
Events
Listen for events using theon method on the widget instance.
Emitted when the widget has fully loaded and is ready for user interaction.
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