--- title: useStorage description: Returns the key-value `Storage` interface for the extension point. api_version: 2023-04 api_name: checkout-ui-extensions source_url: html: >- https://shopify.dev/docs/api/checkout-ui-extensions/2023-04/react-hooks/storage/usestorage md: >- https://shopify.dev/docs/api/checkout-ui-extensions/2023-04/react-hooks/storage/usestorage.md --- # use​Storage Returns the key-value `Storage` interface for the extension point. ## use​Storage() ### Returns * Storage ### Storage A key-value storage object for extension points. Stored data is only available to this specific app at this specific extension point. The storage backend is implemented with `localStorage` and should persist across the buyer's checkout session. However, data persistence isn't guaranteed. * read \(key: string) => Promise\ 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\ Write stored data for this key. The data must be serializable to JSON. * delete (key: string) => Promise\ Delete stored data by key. ### Storage A key-value storage object for extension points. Stored data is only available to this specific app at this specific extension point. The storage backend is implemented with \`localStorage\` and should persist across the buyer's checkout session. However, data persistence isn't guaranteed. * read 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. ```ts (key: string) => Promise ``` * write Write stored data for this key. The data must be serializable to JSON. ```ts (key: string, data: any) => Promise ``` * delete Delete stored data by key. ```ts (key: string) => Promise ``` ```ts export interface Storage { /** * 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. */ read(key: string): Promise; /** * Write stored data for this key. * * The data must be serializable to JSON. */ write(key: string, data: any): Promise; /** * Delete stored data by key. */ delete(key: string): Promise; } ``` ## Related [APIs - StandardApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/standardapi) [APIs - CheckoutApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/checkoutapi) [APIs - OrderStatusApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/orderstatusapi) [APIs - CartLineDetailsApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/cartlinedetailsapi) [APIs - PickupPointsApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/pickuppointsapi) [APIs - PickupLocationsApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/pickuplocationsapi) [APIs - ShippingMethodDetailsApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/shippingmethoddetailsapi) [APIs - ExtensionPoints](https://shopify.dev/docs/api/checkout-ui-extensions/apis/extensionpoints)