Hello, im building shopify app extensions to making loyalty function to my store.
But in both dev and beta env, i cannot call app proxy to get data from my backend. I always get this error
So, i follow this instruction to add mode: ‘no-cors’ to my request. Cors error disappear, and i get 302 response.
You don’t necessarily need to call your app proxy from a UI extension, you can just call your server directly as long as you have the network_access capability and you’ve requested access from the partner dashboard. You just need to make sure that you’re using the SessionToken api to validate that these requests came from your extension.
I have the same problem on the Checkout UI extensions.
As @Kenza_Iraki said, we can avoid using the app proxy and call our server directly passing a session token, but it just guarantee the integrity of the message, not its origin from Shopify
EDIT: I’ve found out that you get CORS policy error when calling the app proxy if the store is password protected! Make sure to remove it and you should be able to call the app proxy