Interface: ExtensionStorage
Defined in: packages/sdk/src/extension-storage.ts:13
Namespaced, persisted key/value storage handed to side-panel components via SidePanelProps.storage. Each panel id gets its own bag; values are persisted alongside the rest of the app state.
The store is hydrated asynchronously after the panels mount, so consumers that need to wait for restored values should check props.hydrated or use subscribe to re-read once it flips.
Methods
get()
Call Signature
get<T>(key): T | undefined;Defined in: packages/sdk/src/extension-storage.ts:15
Read a value. Returns fallback if the key is missing.
Type Parameters
T
T
Parameters
key
string
Returns
T | undefined
Call Signature
get<T>(key, fallback): T;Defined in: packages/sdk/src/extension-storage.ts:16
Type Parameters
T
T
Parameters
key
string
fallback
T
Returns
T
set()
set(key, value): void;Defined in: packages/sdk/src/extension-storage.ts:18
Write a value. undefined deletes the key.
Parameters
key
string
value
unknown
Returns
void
subscribe()
subscribe(listener): () => void;Defined in: packages/sdk/src/extension-storage.ts:24
Subscribe to changes in this namespace. Called on any set within this namespace, and also whenever the underlying app state finishes hydrating (so callers can re-read after persisted state loads).
Parameters
listener
() => void
Returns
() => void