DictationClient.show(), or in React as props on <Dictation>.
Callback execution
It calls onSubmit after the user commits, and onCancel if they leave without committing. If you supply onDraft, the SDK may call it when the user does not submit and switches to another field (or otherwise moves on without committing). onDraft is not invoked on every live transcript change while Dictation stays on one field. The SDK does not persist draft text to your systems; only your onDraft handler decides whether to store or send it to your partner backend.
Payload
Every callback receives the same argument: one object, { fieldId, text }. The fieldId value is whatever you passed into show() or <Dictation>. A common pattern is to set it to the same value as the target control’s id, so onSubmit can use document.getElementById(fieldId) and write text into that element.
Supported callbacks
Dictation SDK supports the following callbacks: Mode controls how Dictation is shown. Set it toin-field when the UI is tied to a container on your page, or scratchpad for a standalone Dictation UI. Refer to In-field mode and Scratchpad mode guides for behavior and layout.
Content Rewrite runs inside the hosted iframe and does not add callbacks. When the clinician submits,
onSubmit still receives { fieldId, text } for the full field, including rewritten text. Refer to Content Rewrite for more details.Callback contract payload shape
All callbacks receive a single argument: an object with these fields:Code examples
Use callbacks as properties on the object you pass to
await dictationClient.show({ ... }). They sit alongside mode, fieldId, rootElement, initialText, and other options from Configuration.The iframe resizes to the container you pass as rootElement when you use in-field mode.JavaScript
Calling
show() again replaces the active session; you do not need to call hide() between fields for that pattern. Wrap show() in try / catch if you want to log configuration or auth failures.Refer to the Error handling guide for more details.