Install
With an active licence, the dashboard (Billing → Editor plugin) gives you your install command, with a personal link:@doconda/editor. It needs React 19 or later.
Your first editor
srcis the file’s link: a.docx,.pptxor.xlsx. For example, theurlof a file fromGET /documents/{id}/outputs.- The format is inferred from the link’s extension. If the link has none, pass it with
format="docx","pptx"or"xlsx". - The editor takes the height you give it: put it in a container with a height.
licenseKeyis your licence key (from the dashboard, under Billing → Editor plugin). Not needed onlocalhost.
Open from memory or with headers
If you already have the file (an<input type="file">, a response from your API), pass it with file: a File, Blob,
ArrayBuffer or Uint8Array.
requestInit is passed as is to fetch:
Save
Get the edited file through aref:
fileName says). The ref also has bytes() (the bytes, not
wrapped in a File), focus() and isDirty() (whether there are unsaved changes).
Or listen for Ctrl/Cmd+S with onSave, which receives the file’s bytes:
autosave, onSave is called once the user has gone that long (in milliseconds) without touching anything.
onDirtyChange tells you when there start to be unsaved changes and when they are saved. confirmOnLeave asks for
confirmation if the page is closed or reloaded with pending changes.
To save it in Doconda as a new version of the document (with its review, PDF and change report), send that
file to POST /documents/{id}/versions:
What it can do
Whatever the editor does not touch is saved as is: styles, charts, notes or parts of the file it cannot edit are not
lost.