Packages
npm install pulls the WASM artifacts with the packages. There is no separate WASM build step
and no Emscripten toolchain to install.
Cross-origin isolation
This is the one thing that stops a first attempt working. The SDK needsSharedArrayBuffer,
which browsers only expose to a cross-origin isolated page.
Serve both headers:
vite.config.ts
vercel.json
coi-serviceworker.js does, and it is also what forces the one-time reload you will see on
Safari.
If you see SharedArrayBuffer is not defined, the page is not isolated. Nothing else is
wrong.
Registering a backend
Register before initializing.autoRegister picks the CPU or WebGPU build for the current browser.
Build-time configuration
For a hosted deployment, two Vite variables boot the SDK straight into production:
Both must be set, or the app boots in the development environment.