How to obtain data outside of post-purchase checkout

Topic summary

Goal: Access data collected in a storefront modal during the post-purchase checkout extension.

  • The developer saves modal responses to browser localStorage and wants to read them in a post-purchase React extension. Attempting to use localStorage inside the extension failed.

  • Update from Discord: Checkout extensions run in a sandbox and don’t have access to standard browser APIs like localStorage. This is why reading localStorage in the post-purchase extension doesn’t work.

  • Supported options:

    • Use Shopify’s Checkout Extensions Storage API to persist and retrieve data within the extension’s allowed context.
    • If the data is available pre-checkout, send it from the storefront to your server and store it in a database. Then, during the ShouldRender post-purchase extension point, fetch the data from your server for use in the extension.
  • Status: No direct localStorage access in post-purchase. Clear guidance provided (Storage API or server-side handoff), but implementation/confirmation from the author is not yet reported; discussion remains open.

Summarized with AI on February 5. AI used: gpt-5.

I’m developing two integrations to a Shopify ecommerce.

First integration

The ecommerce customer will fill a form modal with some informations. After that, the browser will save some responde informations into localStorage.

Second Integration

This is the post-purchase checkout. I need to access a information from that response, wich I can only get on modal request. I’ve tried to use localStorage inside post-purchase react code, but didn’t work. There is a way to pass or receive an info directly for post-purchase?

According to Discord answers:

“Hey Allan, the post you linked is about an extension not rendering, I understand you are asking about local storage instead? The extensions are running in a sandbox, so you don’t have access to all the browser APIs you would normally have access to. There is a storage API we provide though, please see https://shopify.dev/api/checkout-extensions/extension-points/api#storage and the code in https://shopify.dev/apps/checkout/post-purchase/getting-started-post-purchase-extension#step-3-build-the-extension-ui.”

“If this data is available before checkout, you could send it from the storefront to your server and save it in a DB. Then in the ShouldRender post-purchase extension point, you can fetch if from your server”

https://discord.com/channels/842813079926603828/1040012094621364235/1040338981700771981

https://discord.com/channels/842813079926603828/1040012094621364235/1040757147455205516