Skip to main content
SuperDoc SDKs let you open, read, and edit .docx files from Node.js or Python. They manage the CLI process for you and expose typed methods for every operation.
The SDKs are in alpha. The API surface matches the Document API and will evolve alongside it.

Installation

The CLI is bundled with the SDK — no separate install needed.

Quick start

The Node SDK supports both ESM and CommonJS:
Set defaultChangeMode: 'tracked' (Node) or default_change_mode='tracked' (Python) to make mutations use tracked changes by default. If you pass changeMode on a specific call, that explicit value overrides the default. The Python SDK also exposes synchronous SuperDocClient with the same doc.* operations when you prefer non-async code paths.

User identity

By default the SDK attributes edits to a generic “CLI” user. Set user on the client to identify your automation in comments, tracked changes, and collaboration presence:
The user is injected into every doc.open call. If you pass userName or userEmail on a specific doc.open, those per-call values take precedence.

Collaboration sessions

Use this when your app already has a live collaboration room (Liveblocks, Hocuspocus, or SuperDoc Yjs).

Join an existing room

Pass collabUrl and collabDocumentId to doc.open:

Start an empty room from a local .docx

If the room is empty, pass doc together with collaboration params:
What happens when you pass doc:

Control empty-room behavior

The three onMissing values:
If you reopen an existing ydoc without providing a doc file, the default seedFromDoc will seed a blank document if the room appears empty during sync. This overwrites your existing content. Always use onMissing: 'error' when reopening documents that were previously created or populated.

Check if the SDK seeded or joined

doc.open returns bootstrap details in collaboration mode:

Available operations

The SDKs expose all operations from the Document API plus lifecycle and session commands. The tables below are grouped by category.

Core

Format

Create

Sections

Lists

Tables

Table of contents

Images

Comments

Track changes

History

Session

  • Document API — the in-browser API that defines the operation set
  • CLI — use the same operations from the terminal
  • Collaboration guides — set up Liveblocks, Hocuspocus, or SuperDoc Yjs