Returns the key-value `Storage` interface for the extension target.
Returns the key-value `Storage` interface for the extension target.
export function useStorage< Target extends RenderExtensionTarget = RenderExtensionTarget, >(): Storage { return useApi<Target>().storage; }
A key-value storage object for extension targets. Stored data is only available to this specific app at this specific extension target. The storage backend is implemented with `localStorage` and should persist across the buyer's checkout session. However, data persistence isn't guaranteed.
Read and return a stored value by key. The stored data is deserialized from JSON and returned as its original primitive. Returns `null` if no stored data exists.
Write stored data for this key. The data must be serializable to JSON.
Delete stored data by key.