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 '@harbour-enterprises/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