Skip to main content

Overview

Dictation supports two modes and a small callback contract. All callbacks receive { fieldId, text }. This guide follows Dictation Modes, Callback Contract, and ShowOptions in Suki Dictation SDK.md.

Dictation modes

ModeBehavior
in-fieldOverlays the input container; provide rootElement when possible
scratchpadFloating standalone dictation UI when dictation is not tied to a specific field
JavaScript
mode: "scratchpad";
Use scratchpad when dictation is not tied to a specific input field.

Callback contract

Payload shape for every callback:
JavaScript
{
  fieldId: string,
  text: string
}
CallbackRequiredPurpose
onSubmitYesCommit dictation result
onCancelNoDiscard session
onDraftNoIntermediate updates while the user dictates
Example:
JavaScript
onSubmit: ({ fieldId, text }) => save(fieldId, text);
If onSubmit is missing, dictation often closes immediately after the user acts. Always provide onSubmit.

ShowOptions summary

FieldRequiredDescription
modeYes"in-field" or "scratchpad"
fieldIdYesIdentifier echoed in callbacks
rootElementRecommendedContainer for the iframe
initialTextNoSeed content
onSubmitYesCompletion callback
onCancelNoCancellation callback
onDraftNoIncremental updates
See Configuration reference for the same tables alongside AuthConfig.

Next steps

Last modified on June 30, 2026