Provider shape
superdoc/super-editor.
Request model
Eachcheck() call receives:
documentIdwhen availabledefaultLanguageas the configured fallbackmaxSuggestionswhen setsegments, where each segment includesid,text,language, andmetadatasignal, which you should pass through to your network call or worker task
Segment shape
Offset rules
Offsets must be zero-based UTF-16 code-unit offsets into the exactsegment.text string that SuperDoc sends.
startis inclusiveendis exclusive
segment.text === 'teh contract', the misspelling teh should be returned as:
Returning issues
Each issue must include:segmentIdstartendkind
messagereplacements- shown as direct context-menu replacement actions when presentruleIdproviderMeta
Only
kind: 'spelling' is rendered in the v1 UI. Providers can return grammar or style issues too, but they are not displayed yet.Example: call your own API
Best practices
- Honor
signalso cancelled checks stop immediately - Use
maxSuggestionswhen your provider can limit results server-side - Return
kind: 'spelling'for issues you want rendered in the current UI - Keep the provider pure: no DOM access, no editor assumptions
- Batch segments when your backend supports it
Ignore is a SuperDoc-side suppression in v1, not a provider dictionary mutation. If you want ignored words to persist across reloads, store your own list and pass it back through proofing.ignoredWords the next time you create the editor.Troubleshooting
If proofing markers do not appear:- Confirm
proofing.enabledistrue - Confirm the provider returns
kind: 'spelling' - Confirm
startandendoffsets match the exactsegment.textstring - Confirm the layout engine is active
- Use
proofing.onProofingErrorto surface validation or provider failures in your app
Working examples
If you want a concrete starting point, see the repo examples:- Typo.js example - Minimal local spell-check provider
- LanguageTool self-hosted example - Minimal self-hosted HTTP provider

