> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superdoc.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrate from ProseMirror to SuperDoc

SuperDoc is built on ProseMirror but provides a complete document editing solution rather than a framework.

<Warning>
  **ProseMirror internals are deprecated.** Direct access to `editor.state`, `editor.view`, `editor.schema`, `editor.commands`, and ProseMirror transactions will be removed in a future version. Use the [Document API](/document-api/overview) (`editor.doc`) for all programmatic document operations.
</Warning>

### Key differences

| ProseMirror                         | SuperDoc                         |
| ----------------------------------- | -------------------------------- |
| Framework requiring extensive setup | Ready-to-use DOCX editor         |
| Manual schema definition            | Pre-built Word-compatible schema |
| DIY file format support             | Native DOCX import/export        |
| Custom plugin system                | Module-based features            |

### What changes

```javascript theme={null}
// ProseMirror
import { EditorState } from "prosemirror-state";
import { EditorView } from "prosemirror-view";
import { Schema } from "prosemirror-model";
// ... 100+ lines of setup

// SuperDoc
import { SuperDoc } from "superdoc";
const superdoc = new SuperDoc({
  selector: "#editor",
  document: "document.docx",
});
```

### Programmatic document access

The [Document API](/document-api/overview) (`editor.doc`) replaces direct ProseMirror access for all programmatic operations. 300+ operations across formatting, comments, tables, track changes, lists, images, and sections.

```javascript theme={null}
superdoc.on("editorCreate", ({ editor }) => {
  // Read document content
  const content = editor.doc.get();

  // Find and replace text
  const matches = editor.doc.query.match({
    select: { type: "text", pattern: "ACME Corp" },
  });
  editor.doc.replace({ target: matches.items[0].target, text: "Globex Inc" });

  // Format text
  editor.doc.format.bold({ target: matches.items[0].target });

  // Add comments
  editor.doc.comments.create({ target, content: "Please review" });
});
```

For backend and AI workflows, use the [Node SDK](/document-engine/sdks), [Python SDK](/document-engine/sdks), or [CLI](/document-engine/cli).

### Deprecated: ProseMirror internals

<Warning>
  The following patterns are deprecated and will stop working in a future version. Migrate to the Document API.
</Warning>

Previously, you could access the underlying ProseMirror instances directly:

```javascript theme={null}
// Deprecated: will be removed
superdoc.on("editorCreate", ({ editor }) => {
  const view = editor.view;
  const state = editor.state;
  const schema = editor.schema;
  editor.commands.toggleBold();
});

// Use the Document API instead
superdoc.on("editorCreate", ({ editor }) => {
  const content = editor.doc.get();
  editor.doc.format.bold({ target });
});
```

### Limitations

* **No custom plugins**: SuperDoc modules aren't ProseMirror plugins
* **Fixed schema**: Can't modify the document schema
* **Use the Document API**: For programmatic operations, use `editor.doc`: not raw ProseMirror transactions

### Custom functionality

If you need features SuperDoc doesn't provide:

* Check the [Document API reference](/document-api/overview): 300+ operations
* Use the [SDK](/document-engine/sdks) or [CLI](/document-engine/cli) for backend workflows
* Request features via [GitHub issues](https://github.com/superdoc-dev/superdoc/issues)

## Need help?

* [GitHub Issues](https://github.com/superdoc-dev/superdoc/issues)
* [Discord Community](https://discord.com/invite/b9UuaZRyaB)
* Email: [q@superdoc.dev](mailto:q@superdoc.dev)
