What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Possible to access the Shopify Ajax API or read/update the cart from an app embed block?

Possible to access the Shopify Ajax API or read/update the cart from an app embed block?

Chad_Johnson
Shopify Partner
33 1 18

I am being told by Shopify that my app may no longer use a ScriptTag and must convert to using an app embed block. My upselling app makes heavy use of the Shopify Ajax API in order to read cart data and replace items in the cart (i.e., when an upsell occurs).

 

Is it even possible to use the Shopify Ajax API from an app embed block? Or, is there another way to update the customer's cart from within an app embed block?

 

My understanding is that these run in a sandboxed web worker environment, similar to how post-checkout extensions work.

 

This new requirement introduced by Shopify is going to completely cripple my app and destroy two years of hard work and significant financial investment...

Reply 1 (1)

Chad_Johnson
Shopify Partner
33 1 18

Nevermind! I made a bad assumption that app embed blocks run in a sandboxed web worker environment, and this appears to not be the case.