Install
Requirements
- Node 20+ — the SDK uses native
fetch,BigInt, andUint32Array. - Modern browsers — any browser supporting ES2022 modules (Chrome 94+, Firefox 93+, Safari 15.4+).
- Zero runtime dependencies.
Dual entry points
| Import | Use from | What's there |
|---|---|---|
@dreamlake/dreamdb | Node, browser, SSR | Core: Dataset, Schema, Space, S3Backend, query primitives, CBOR helpers |
@dreamlake/dreamdb/browser | Browser only | Adds blobUrlFor() for <img> / <video> rendering of blob fields |
Use the core entry from Node code; pull browser only where you actually need URL.createObjectURL.
Verify
You should see Dataset, Schema, Space, S3Backend, MemoryBackend, plus the lower-level query primitives.
ESM + CJS
The package ships both ESM (dist/index.js) and CJS (dist/index.cjs) with matching .d.ts / .d.cts type declarations. package.json's exports map routes the right format automatically based on your project's "type".
Configuring credentials
The SDK never reads files. Credentials flow through the Backend:
For public-read buckets (demo / fixtures), no credentials are needed — anonymous GET works.