@suki-sdk/dictation and @suki-sdk/dictation-react) and in Web SDK Dictation, which uses DictationClient from @suki-sdk/js and @suki-sdk/react. It works in both In-field mode and Scratchpad mode.
Content Rewrite runs entirely in the hosted iframe. You do not send a rewrite API call, handle selection offsets, or apply the rewritten span. When a clinician selects text with the microphone off, the iframe shows the rewrite tooltip, sends the request, and applies the result. Your existing onSubmit and onDraft callbacks receive the updated field text.
No additional package,
ShowOptions field, or callback is required.@suki-sdk/dictation or @suki-sdk/dictation-react v0.1.0-beta.3 or later. For Web SDK Dictation, use the matching release from the same release train. If Dictation is already integrated, you do not install another package.
Common use cases
Shorten Long Dictation
After dictating into a note or form field, the clinician selects a long span, chooses Concise, and keeps documenting in the same session.
Expand Short Notes
The clinician selects brief wording, chooses Verbose, and replaces that span in the Dictation editor without starting another session.
Write for Patients
The clinician selects clinical wording, chooses Patient Friendly, and reviews the rewritten span in the hosted UI before they submit.
Rewrite in a Target Field
Use in-field mode so the clinician dictates into a chart field, then rewrites part of that field with the microphone off.
Rewrite in a Scratchpad
Use scratchpad mode so the clinician drafts in the floating panel, rewrites selected text there, then submits the full scratchpad text to your app.
Same Experience in Web SDK Dictation
Web SDK Dictation uses the same hosted iframe, so clinicians get the same rewrite tooltip and styles when Dictation is already in your Web SDK app.
How clinicians use Content Rewrite
The rewrite happens in the Dictation iframe. Your app still receives the full field text through the callbacks you already register.1
Open Dictation
The clinician opens Dictation in in-field or scratchpad mode the same way they do today.
2
Turn Off the Microphone and Select Text
The clinician turns the microphone off, then selects the text they want to change. While the microphone is streaming, the rewrite tooltip stays hidden. The tooltip appears only when the selection has at least two words.
3
Choose a Rewrite Style
From the rewrite tooltip, the clinician chooses Concise, Verbose, or Patient Friendly. The hosted iframe sends the rewrite request. The UI shows Rewriting…. The clinician can select Cancel while the rewrite runs. Your app does not handle that HTTP call.
4
Replace the Selection or Retry
On success, Suki replaces only the selected span. The rest of the field stays as it is. If the rewrite fails, the UI shows Rewrite failed. Please try again. with Try again and Cancel. The SDK does not retry on its own.
5
Submit the Field
When the clinician submits,
onSubmit receives { fieldId, text } for the full field value, including any rewritten spans. Optional onDraft works the same way for unfinished text.ShowOptions and callbacks
Content Rewrite does not change theShowOptions contract. Pass the same options you pass for any Dictation session.
Content Rewrite also does not support custom rewrite instructions from your app, and it does not run while the microphone is streaming.
Code examples
The following JavaScript and React code examples use the same Dictation setup you already have. When a clinician rewrites text in the iframe,onSubmit and onDraft receive the updated field text.
- JavaScript
- React
Pass your usual options to
DictationClient.show(). Web SDK Dictation uses the same call with DictationClient from @suki-sdk/js.JavaScript
Scratchpad mode
Content Rewrite works the same way in scratchpad mode. The clinician turns off the microphone, selects text, and rewrites it in the hosted UI. The final text still arrives ononSubmit.
JavaScript
Best practices
Next steps
Callbacks -onSubmit, onCancel, and onDraft payload shape.
Configuration - Every ShowOptions field.
In-field mode - Attach Dictation to a single field.
Scratchpad mode - Run Dictation in a floating panel.