@parity/product-sdk-local-storage
Key-value storage backed by the host container.
createLocalKvStore returns a LocalKvStore backed by the host-provided
HostLocalStorage. It runs only inside a Polkadot host container (Browser /
Desktop) and throws if host storage is unavailable.
npm install @parity/product-sdk-local-storageExports
Functions
| Name | Summary |
|---|---|
createLocalKvStore() | Create a key-value store. |
Interfaces
| Name | Summary |
|---|---|
LocalKvStore | Async string local key-value store, with getJSON/setJSON for structured values. Returned by createLocalKvStore. |
LocalKvStoreOptions | Optional configuration for createLocalKvStore: a key prefix to namespace entries, or an explicit host-storage handle that overrides auto-detection. |
Re-exports
Convenience re-exports from leaf packages. Click through for the canonical documentation.
| Name | Kind | Source package |
|---|---|---|
HostLocalStorage | interface | @parity/product-sdk-host |
Functions
createLocalKvStore()
Create a key-value store.
Uses the host localStorage when inside a container. The SDK is designed to run exclusively inside a host container.
createLocalKvStore(options?: LocalKvStoreOptions): Promise<LocalKvStore>Throws
- If host storage is unavailable (not inside a container).
Interfaces
interface LocalKvStore
Async string local key-value store, with getJSON/setJSON for structured values. Returned by createLocalKvStore.
Methods
get
get(key: string): Promise<string | null>getJSON
getJSON(key: string): Promise<T | null>remove
remove(key: string): Promise<void>set
set(key: string, value: string): Promise<void>setJSON
setJSON(key: string, value: unknown): Promise<void>interface LocalKvStoreOptions
Optional configuration for createLocalKvStore: a key prefix to namespace entries, or an explicit host-storage handle that overrides auto-detection.
Properties
hostLocalStorage
HostLocalStorageOverride auto-detection. When provided, routes all ops through this host storage.
prefix
stringKey prefix to namespace storage keys (e.g. “myapp” → keys become “myapp:theme”).