Skip to main content

Requirements

  • Node.js 22.13 or newer for server-side use and repository tooling
  • An ESM-capable project
  • A modern browser with WebAssembly for client-side evaluation
  • TypeScript is recommended but not required by consumers
InvariantCAD is ESM-only. CommonJS require("invariantcad") is not a supported entry path.

Add the package

The package includes the TypeScript declarations, declaration maps, bundled Manifold JavaScript/WebAssembly runtime, and the stock occt-wasm dependency. The optional InvariantCAD-owned OCCT facade is not downloaded implicitly and is not part of the 0.1 npm package.

Confirm ESM configuration

For Node.js, use an ESM source file (.mjs) or mark the consuming package as ESM:
package.json
Then verify a default-kernel import:

TypeScript settings

InvariantCAD targets modern ESM and works best with a modern module resolver:
tsconfig.json
Bundler-based applications can use module: "ESNext" and moduleResolution: "Bundler" instead.

WebAssembly assets

The default Manifold runtime is bundled with InvariantCAD. In a normal Vite or similar production build, the runtime resolves its sibling WASM asset through import.meta.url. If an environment rewrites asset URLs, pass the final URL:
The Manifold module is initialized once per JavaScript realm. A later request cannot change the configured URL after initialization. OCCT has a larger separate runtime and additional initialization forms. Follow the OpenCascade guide for Node, browser, and custom facade setup.

Package-manager install scripts

Some strict package-manager configurations block dependency build scripts. The stock OCCT and browser toolchains may require explicitly allowing their documented runtime preparation. Do not enable arbitrary install scripts globally; scope any exception to the package that requires it and keep the lockfile reviewed.
Never copy a WASM file from an unrelated version. JavaScript glue and WASM binaries are a matched pair. A mismatch can fail during initialization or, for native facade extensions, violate the advertised ABI.

Next step

Build and export a parameterized model in the quickstart.