Shared storage between checkout ui extensions

Solved

Shared storage between checkout ui extensions

adkhamllama
Shopify Partner
27 1 50

Hello, I have an issue with useStorage hook in checkout ui extension. I've been trying to write data in one block and read data in second block, but all I get is null. Docs says that data is shared across all activated extension targets of this extension. So same type blocks can read each others data, but not different blocks.
Would it be possible to share data between different blocks as well?

Accepted Solution (1)
adkhamllama
Shopify Partner
27 1 50

This is an accepted solution.

Yes, I wanted to connect 2 checkout ui extensions Storage API didn't help. But I found a different way to communicate - through metafields.

View solution in original post

Replies 2 (2)

Liam
Community Manager
3108 341 879
Hi Adkhamllama,
 
By different blocks do you mean different extension? I believe the scope is limited to extension in terms of sharing data, so two different extensions would not share data. Also, make sure you're not using an older API version:
In versions 2023-07 and earlier, each activated extension target had its own storage.

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

adkhamllama
Shopify Partner
27 1 50

This is an accepted solution.

Yes, I wanted to connect 2 checkout ui extensions Storage API didn't help. But I found a different way to communicate - through metafields.