Skip to main content
The editor plugin is a React component you add to your product. Your users open a Word, PowerPoint or Excel file (for example, the one your agent just created with Doconda), touch it up and save it, without leaving your site. Everything happens in their browser: the file is not uploaded anywhere to be edited. It is purchased separately from the API, per organization, with a monthly, yearly or one-time plan and a 7-day free trial. See licence and domains.

Install

With an active licence, the dashboard (Billing → Editor plugin) gives you your install command, with a personal link:
It is imported as @doconda/editor. It needs React 19 or later.
The link is secret: don’t publish it. If the licence stops being active, the link stops working. Every download carries a mark identifying your organization.

Your first editor

  • src is the file’s link: a .docx, .pptx or .xlsx. For example, the url of a file from GET /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.
  • licenseKey is your licence key (from the dashboard, under Billing → Editor plugin). Not needed on localhost.

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.
If the link needs authentication, requestInit is passed as is to fetch:

Save

Get the edited file through a ref:
The file keeps the original’s name (or whatever 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:
Or let it save on its own: with 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:
Make that call from your server: the API key must not reach the browser.

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.

Props