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

Creating an instance

import { SuperDoc } from 'superdoc';

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

Instance lifecycle

// 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 - Settings passed at creation
  • Methods - Control the editor, access properties and types
  • Events - Lifecycle and change notifications