> ## Documentation Index
> Fetch the complete documentation index at: https://superdoc-caio-pizzol-docs-ai-core-preset.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# SuperDoc API

The SuperDoc instance is your main interface for controlling the DOCX editor. It handles document loading, editor management, and all interactions.

## Creating an instance

```javascript theme={null}
import { SuperDoc } from 'superdoc';

const superdoc = new SuperDoc({
  selector: '#editor',
  document: 'contract.docx'
});
```

## Instance lifecycle

```javascript theme={null}
// 1. Creation
const superdoc = new SuperDoc(config);

// 2. Ready event
superdoc.on('ready', () => {
  // Now safe to use methods
});

// 3. Runtime operations
superdoc.setDocumentMode('suggesting');
superdoc.export();

// 4. Cleanup
superdoc.destroy();
```

## API structure

* **[Configuration](/editor/superdoc/configuration)** - Settings passed at creation
* **[Methods](/editor/superdoc/methods)** - Control the editor, access properties and types
* **[Events](/editor/superdoc/events)** - Lifecycle and change notifications
