Version 2025-07 is the last API version to support React-based UI components. Later versions use web components, native UI elements with built-in accessibility, better performance, and consistent styling with Shopify's design system. Check out the migration guide to upgrade your extension.
Storage API
The Storage API lets you persist key-value data scoped to the customer across sessions. Use this API to store customer preferences, dismissed states, or other lightweight data that should survive navigation and return visits.
Anchor to Use casesUse cases
- Remember customer preferences: Save choices like preferred language, display options, or notification settings so they persist across visits.
- Track dismissed content: Store whether a customer has dismissed a promotional banner or onboarding message so it doesn't reappear.
- Cache lightweight data: Store small pieces of data to reduce redundant API calls, such as a customer's loyalty tier or last-viewed order.
Supported targets
- Customer
Account::Kitchen Sink - customer-account.
footer. render-after - customer-account.
order-index. announcement. render - customer-account.
order-index. block. render - customer-account.
order-status. announcement. render - customer-account.
order-status. block. render - customer-account.
order-status. cart-line-item. render-after - customer-account.
order-status. cart-line-list. render-after - customer-account.
order-status. customer-information. render-after - customer-account.
order-status. fulfillment-details. render-after - customer-account.
order-status. payment-details. render-after - customer-account.
order-status. return-details. render-after - customer-account.
order-status. unfulfilled-items. render-after - customer-account.
order. action. menu-item. render - customer-account.
order. action. render - customer-account.
order. page. render - customer-account.
page. render - customer-account.
profile. addresses. render-after - customer-account.
profile. announcement. render - customer-account.
profile. block. render - customer-account.
profile. company-details. render-after - customer-account.
profile. company-location-addresses. render-after - customer-account.
profile. company-location-payment. render-after - customer-account.
profile. company-location-staff. render-after - customer-account.
profile. payment. render-after
Supported targets
- Customer
Account::Kitchen Sink - customer-account.
footer. render-after - customer-account.
order-index. announcement. render - customer-account.
order-index. block. render - customer-account.
order-status. announcement. render - customer-account.
order-status. block. render - customer-account.
order-status. cart-line-item. render-after - customer-account.
order-status. cart-line-list. render-after - customer-account.
order-status. customer-information. render-after - customer-account.
order-status. fulfillment-details. render-after - customer-account.
order-status. payment-details. render-after - customer-account.
order-status. return-details. render-after - customer-account.
order-status. unfulfilled-items. render-after - customer-account.
order. action. menu-item. render - customer-account.
order. action. render - customer-account.
order. page. render - customer-account.
page. render - customer-account.
profile. addresses. render-after - customer-account.
profile. announcement. render - customer-account.
profile. block. render - customer-account.
profile. company-details. render-after - customer-account.
profile. company-location-addresses. render-after - customer-account.
profile. company-location-payment. render-after - customer-account.
profile. company-location-staff. render-after - customer-account.
profile. payment. render-after
Anchor to PropertiesProperties
The Storage API object provides key-value storage scoped to the customer. Access the following properties on the API object to read, write, and delete persistent data across sessions.
- Anchor to storagestoragestorageStorageStoragerequiredrequired
Key-value storage that persists across customer sessions. Data is scoped to your app and shared across all extension targets.
Storage
Key-value storage that persists across customer sessions. Data is scoped to your app and shared across all extension targets.
- delete
Deletes the stored data for the given key.
(key: string) => Promise<void> - read
Reads and returns a stored value by key. The stored data is deserialized from JSON and returned as its original type. Returns `null` if no data exists for the given key.
<T = unknown>(key: string) => Promise<T> - write
Writes data for the given key. The data must be serializable to JSON.
(key: string, data: any) => Promise<void>
Anchor to Best practicesBest practices
- Store only small values: Keep stored data lightweight. Storage is intended for simple key-value pairs like preferences and flags, not large datasets.
- Use descriptive keys: Name your storage keys clearly (for example,
promo_dismissedorlocale_pref) so their purpose is obvious and conflicts with other extensions are unlikely. - Handle missing values gracefully: Always check for
nullorundefinedwhen reading from storage, since the value may not exist on the customer's first visit. - Don't store sensitive data: Storage isn't encrypted. Don't store personal information, tokens, or anything that could compromise customer privacy.
Anchor to LimitationsLimitations
- Storage is scoped per customer and per extension. You can't share data between different extensions or access another customer's stored values.
- On the pre-authenticated Order status page, storage is scoped to the customer associated with the order, not the browsing session.
- All values are stored as strings. You must serialize and deserialize complex types (like JSON objects).