JavaScript bindings for loading and driving VTK compiled to WebAssembly — build 3D visualizations in the browser with no C++ required.
Full documentation, guides, and API reference:https://kitware.github.io/vtk-wasm/
Install the package:
npm install @kitware/vtk-wasmLoad the runtime, create a session, and use its vtk namespace:
import{loadAsync}from"@kitware/vtk-wasm";constBUNDLE="https://raw.githack.com/Kitware/vtk-wasm/dist/latest/vtk-wasm32-emscripten.tar.gz";construntime=awaitloadAsync({url: BUNDLE});constsession=runtime.createStandaloneSession();constvtk=session.vtk;constcone=vtk.vtkConeSource();// ... build and render your sceneNo build step? Load the UMD bundle from a CDN and use the global vtkwasm:
<scriptsrc="https://unpkg.com/@kitware/vtk-wasm/vtk-umd.js"></script>See the Loading VTK.wasm guide to get started and the API reference for every export.
Requires Node.js (LTS).
npm install # install dependencies
npm run build # build the ESM + UMD bundles into dist/
npm run docs:dev # run the documentation site locally
npm run lint # lint the sourcesrc/— library source.examples/— example applications.docs/— documentation site (VitePress); the API reference is generated from source JSDoc.dist/— build output.