Basic Example
Bundler Setup
Vite
No special configuration needed:Webpack
Webpack 5+ handles conditional exports automatically:esbuild
First-Use Downloads
On first initialization, Rehydra downloads:| Data | Size | Storage |
|---|---|---|
| NER Model (quantized) | ~280 MB | OPFS |
| Semantic Data | ~4 MB | IndexedDB |
Storage in Browsers
Model Storage (OPFS)
Large model files use the Origin Private File System:- Persistent across sessions
- Not visible in DevTools
- Quota managed by browser
- Cleared with “Clear site data”
PII Map Storage (IndexedDB)
For session-based storage:ONNX Runtime
The NER model requiresonnxruntime-web. It’s loaded automatically:
Browser Compatibility
| Browser | Minimum Version | Notes |
|---|---|---|
| Chrome | 86+ | Full support |
| Edge | 86+ | Full support |
| Firefox | 89+ | Full support |
| Safari | 15.4+ | Full support |
Offline Support
After initial download, everything works offline:Memory Considerations
The NER model uses ~200-300 MB RAM when loaded. For memory-constrained environments:Web Workers
For non-blocking UI, run Rehydra in a Web Worker:CSP Considerations
If using Content Security Policy, ensure these are allowed:What’s NOT Available in Browser
The browser build excludes:SQLitePIIStorageProvider(useIndexedDBPIIStorageProvider)- Streaming anonymization (
rehydra/streaming) - LLM proxy middleware (
rehydra/proxy) - Node.js
fs,path,osmodules - Direct file system access
Next Steps
Sessions & Storage
IndexedDB storage for browsers
Installation
Bundler-specific setup