Showing CORS issue while call shopify proxy in checkout

I’m trying to access a Shopify App Proxy endpoint from a Checkout UI Extension in a Shopify development store, but I’m seeing a CORS error in the browser console. Is this expected behavior? Does Shopify App Proxy only work on a production store without storefront password protection, or should it also work in a development store?

You can’t call an app proxy from a Checkout UI extension to get the user info. Instead, you need to enable network access for your extension and call your backend directly without an app proxy. Within your extension, you can use the React hook useSessionToken() to get a session token to send to your backend for request authentication.

I already allowed network access for my app. but still facing CORS issue.

It is explained here: you can use the app proxy, but you won’t have the logged-in user. As the documentation explains, you must use a session token and ensure that your backend returns this header: Access-Control-Allow-Origin: *

Both guest user and logged in user have the issue, so your trying to saying that this is not a dev password protection issue.

According to the app proxy section of the documentation

UI extension requests made to the App Proxy of password protected shops is not supported. Extension requests come from a web worker which does not share the same session as the parent window.

Therefore, as I mentioned in my first response, it is better to call your backend directly without using the app proxy

Yes without app proxy when i try with plain node express it seems working fine. only app proxy have the issue, also app proxy working fine in other places as expected.

It’s probably the same issue as yours, you can’t call app proxy for a protected store

Yes, this something shopify need provide solution to test proxy in dev store with password protection.

I don’t think they will ever do that because it’s a browser limitation due to a security decision for the checkout. Requests are isolated in a web worker and don’t share the same session. Therefore, I recommend communicating directly with your backend for the extension and using a session token for authentication.

You can use this package in your express app to authenticate the session

This is for express app right? not for proxy right?

The package is framework-agnostic; there are multiple adapters depending on what you’re using.
For Express, you can use the Node adapter, as shown in the package’s README.