Skip to main content

SDK

Open-source packages on npm @spherescan.

PackagePurpose
@spherescan/modelParse / serialize / validate SCAN YAML & JSON
@spherescan/rulesLegal connection pairs + port checks
@spherescan/viewerProject model → board graph; SVG/PNG export
@spherescan/modelerCommand stack: move, connect, create, auto-layout, undo
@spherescan/clivalidate, export svg, …
@spherescan/boardShared React canvas (private in early releases; used by Sphere / whiteboard)

Install

npm i @spherescan/model @spherescan/rules @spherescan/viewer @spherescan/modeler
npm i -D @spherescan/cli

Validate

npx scan validate ./architecture.scan.yaml

Embed a viewer

import { ScanViewer } from '@spherescan/viewer';

const viewer = new ScanViewer({ container: '#canvas' });
await viewer.importYAML(yamlString);

Modeler adds editing on the same model (command stack, create/connect/move, undo). Prefer public Scan* APIs (ScanModel, ScanViewer, ScanModeler). Legacy Sphere* / sphere: aliases remain for compatibility.

Source and issues: scan-js on GitHub.