API reference
Self-hosted SDK 1.2.1 · npm / CDN 1.2.1 · MPL-2.0
Core embed API 1.0 is stable. Net selection retains the 3D camera; unrelated geometry fades to translucent gray in Dim mode. The current SDK reduces rendering work during motion, inspects saved schematic classes and links 2D component hover to the BoM. Expanded 3D, saved BOM, linked previews and registered WayriCAD results remain available. The same release is available through npm/CDN. Release details and downloads ↗
This reference describes the 0.3.0 base API and later self-hosted additions. The 0.4.0 additions include native 3D result registration, saved layers and linked probes; 0.5.0 adds saved BoM and board data. The current npm/CDN package is 1.2.1. The separately maintained IRCA demonstrations may have additional site-specific capabilities. Import from the versioned module or use the same names on the classic KiCadWebView global.
import { Viewer, EMBED_API_VERSION } from
'https://unpkg.com/@wayrisignals/kicad-webview@1.2.1/dist/kivi-viewer.js';
console.log(EMBED_API_VERSION); // '1.0'
No package manager is required. Types in this reference use TypeScript notation to explain the JavaScript inputs; they do not require a TypeScript build.
Public exports
The table includes the base exports and identifies later additions by version. Types and interfaces describe data, not additional runtime exports.
createStandaloneHTML is exported by the main entry and the separate /html module.
Embed API version
const EMBED_API_VERSION: '1.0'
This legacy embedding-contract identifier is retained for compatibility. It is separate from the SDK/package release version. Reading it has no side effects and does not test browser capabilities, source compatibility or solver validity. Pin the complete release directory when integrating; this identifier alone does not freeze every future beta implementation.
Shared conventions
- Targets are a CSS selector or a browser
HTMLElement. Give the mount a real height. A container can have one viewer owner; dispose it before reusing the container. - Themes are
'light' | 'dark'. Native drawing views are'pcb' | 'schematic' | '3d' | 'manufacturing', subject to the loaded source kind. - Saved drawing coordinates are millimetres. A 2D camera’s zoom is CSS pixels per millimetre. 3D camera vectors are board-centred millimetres.
- Attach event listeners before loading. Events are native
CustomEvents; read theirdetailrather than DOM attributes. - A successful asynchronous source operation returns
true. Superseded or disposed work returnsfalse; current failures reject and emit an error event. Check the return value as well as catching rejection. - Use
AbortSignalwhere offered. Cancelling work does not undo successful earlier steps in a multi-step presentation or restore operation. - These APIs display saved designs and supplied results. They do not edit a native design, run native KiCad ERC/DRC, execute firmware or run an engineering solver.
Release boundaries
This release does not expose the later modelsready event, setDemoInteraction method, or display anchor faceSelection / minFaceAreaMm2 options used by newer site code. Use only the methods documented for your pinned copy.
The downloadable release uses MPL-2.0; commercial use and integration need no individual approval. Keep its notices and matching-source link when distributing builds. The source repository is public; input designs and third-party dependencies have separate terms.