Install
Check what you got:
Three entry points
The package ships three builds and picks one for you based on how it is imported:
| Import | Build | Notes |
|---|---|---|
@dreamlake/dreamdb in a bundler | bundler | Vite needs vite-plugin-wasm |
@dreamlake/dreamdb in Node | nodejs | ESM and CJS both work. The only build with Authoring |
@dreamlake/dreamdb/web | web | No bundler plugin. await ready() before anything else |
The /web entry is the one to reach for in a plain page or an import-map setup, because it fetches and instantiates the WebAssembly itself:
Runtime requirements
- Node 20 or newer. Node prints an experimental-feature warning for the WebAssembly import; it is harmless.
- Any browser with WebAssembly.
- No other runtime dependencies. The package is the wasm binary, its bindings, and the entry shims.
Bundlers
Vite, Astro, SvelteKit — install vite-plugin-wasm and add it to plugins. Without it the .wasm import fails at build time as an unresolved asset.
Next.js — set experiments.asyncWebAssembly in the webpack config, or keep DreamDB calls on the server, where the Node build is used and no plugin is needed.
Plain <script type="module"> — use the /web entry above; nothing to configure.
Which SDK for which job
This package reads everywhere, and writes wherever you give it a backend that can PUT. It cannot create a dataset in the browser, and it cannot train a spatial index anywhere. For ingestion pipelines, index training, and PyTorch, use the Python SDK. The two write identical bytes.