StorageAPI
API
The API for interacting with local storage.
Anchor to standardapiStandardApi
The base API object provided to this and other customer-account
extension targets.
Anchor to storage
storage
required
Key-value storage for the extension target.
Was this section helpful?
Anchor to useStorageuse Storage()
use Storage()
Returns the key-value Storage
interface for the extension target.
Anchor to useStorage-returnsReturns
Storage
delete
(key: string) => Promise<void>
Delete stored data by key.
read
<T = unknown>(key: string) => Promise<T>
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
(key: string, data: any) => Promise<void>
Write stored data for this key.
The data must be serializable to JSON.
Was this section helpful?