Skip to main content
Upgrade to Polaris

Version 2025-07 is the last API version to support React-based UI components. Later versions use Polaris web components, native UI elements with built-in accessibility, better performance, and consistent styling with Shopify's design system. Check out the upgrade guide to upgrade your extension and avoid being blocked from updating your extension after October 1st 2026.

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.

  • 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.
Support
Targets (25)

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 storage
storage
required

Key-value storage that persists across customer sessions. Data is scoped to your app and shared across all extension targets.


  • 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_dismissed or locale_pref) so their purpose is obvious and conflicts with other extensions are unlikely.
  • Handle missing values gracefully: Always check for null or undefined when 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.

  • 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).

Was this page helpful?