@brushy/storage is isomorphic: one API for Node.js, browsers, React Native, and SSR.
Runtime matrix
SSR with React
@brushy/storage-react uses getServerSnapshot to return the initialValue on the server, avoiding hydration mismatches:
id) and pass it to StorageProvider.
Instance registry
createStorage({ id })returns a shared instance per process for the sameidgetStorageInstance(id)retrieves without creatingclose()removes from registry; nextcreateStoragecreates fresh
Node.js timers
The expirycheckperiod interval calls unref() when available so background scans do not block process exit.
Cloning
useClones: true uses structuredClone when available. In older environments it falls back to JSON round-trip (functions and undefined in objects are lost).