StorageAPI
The API for interacting with local storage.
Anchor to standardapiStandardApi
The base API object provided to purchase
extension targets.
The key-value storage for the extension.
It uses and should persist across the customer's current checkout session.
Data persistence isn't guaranteed and storage is reset when the customer starts a new checkout.
Data is shared across all activated extension targets of this extension. In versions 2023-07 and earlier, each activated extension target had its own storage.
Anchor to useStorageuse Storage()
Returns the key-value Storage
interface for the extension target.
Anchor to useStorage-returnsReturns
Storage
Delete stored data by key.
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.