Skip to content

API reference > @kontsedal/olas-persist > localStorageAdapter

localStorageAdapter() function ​

The browser's localStorage, as a StorageAdapter — the default storage. SSR-safe: without localStorage every read is null and every write a no-op. A localStorage that throws when the page reads it, as in a sandboxed iframe, counts as missing. A factory, like indexedDbAdapter(), so both adapters are chosen the same way.

Signature:

typescript
export declare function localStorageAdapter(): StorageAdapter;

Returns:

StorageAdapter

Released under the MIT License.