// the find
Blazored/LocalStorage
A library to provide access to local storage in Blazor applications
Blazored.LocalStorage wraps the browser's localStorage API for Blazor apps, automatically serializing values with System.Text.Json and exposing both an async ILocalStorageService and a WebAssembly-only ISyncLocalStorageService. It's for Blazor developers who want typed get/set access to local storage without hand-writing JS interop calls themselves.
Clean separation between async and sync APIs — the sync interface is only exposed where it's actually safe (WASM), instead of faking it everywhere. The streaming package specifically targets the 32KB SignalR message cap in interactive server mode, a real and narrow interop problem rather than a generic add-on. Serialization is pluggable via IJsonSerializer with a documented Newtonsoft swap-in example, so teams aren't locked into STJ's quirks. First-party bUnit test extensions (InMemoryStorageProvider) let you unit test components touching local storage without mocking JS interop by hand.
Last pushed October 2024 — over a year stale, with no sign the interop model has been revisited for newer Blazor render modes that have shipped since. The v3→v4 upgrade silently breaks previously-stored values (old serializer defaults produce unreadable data under the new ones) and changes how strings are persisted on disk, so it's not a safe drop-in version bump. Nothing in the library accounts for localStorage's actual browser storage quota (~5-10MB) — the streaming feature only works around the SignalR message size limit, not the underlying storage ceiling, so large payloads can still fail silently. There's no encryption or obfuscation option, and the README never warns that anything stored is plaintext and visible in devtools, which matters if someone reaches for this to stash tokens.