App proxy has been blocked by CORS at App extension

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
image
So, i follow this instruction to add mode: ‘no-cors’ to my request. Cors error disappear, and i get 302 response.


But i still get correct response when i put this url on top of browser

My backend is nextjs route handler and i configured cors on my be already

Facing similar issue. Can anyone help here?

Hey @BrownTheFlower! We have some docs about this here.

I tried it already, but kept getting those errors

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.

3 Likes

Hi there,

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