Run the browser example
From a checkout of the SearSuite repository, use Node.js 22 and pnpm 9.11. The development command installs no global editor component; it starts the example host and its local collaboration server.
pnpm install
pnpm dev
The example opens in your browser. Use pnpm svg or pnpm webgl to try the other
rendering hosts. The online demo is available on the homepage.
Create a headless Sheet editor
The headless assembly runs the same Sheet command and document contracts without browser input or rendering adapters. In the workspace, import the assembly and a command definition:
import { createHeadlessEditor } from '@searsuite/sear-assembly-headless';
import {
createEmptySheetDocumentState,
ExportSheetStateCommand,
} from '@searsuite/sear-assembly-setup';
const editor = createHeadlessEditor({
sheetState: createEmptySheetDocumentState(4, 4),
});
try {
const snapshot = editor.commands.run(ExportSheetStateCommand, undefined).sheetState;
console.log(snapshot);
} finally {
editor.destroy();
}
createEmptySheetDocumentState(4, 4) supplies the initial document. Commands are the public
mutation and export entry point; destroy() releases the editor's services. A visual host
additionally supplies rendering and input adapters to createSheetEditor().