I am working on an app where I need to make a fetch request from my customer account UI extension to my embedded app backend. I have tried with using app proxy or directly from the app url. All these approach gives me cors error. How can i make this api call succesfully?
1 Like
Did you configure CORS on the app backend?
Hi @Md_Tasin_Tahmid,
In order to make a Fetch request from a Customer Account UI Extension, you do need to have network_access set to true in your shopify.extension.toml configuration file, as well as requesting the use of network_access via your Partner Dashboard.
Additionally configuring CORS as @remy727 mentioned, you do need to ensure your app back end does respond to the HTTP requests with Access-Control-Allow-Origin: * in the Response Headers
And finally there is also some additional limitations and considerations that you should be aware of if you are trying to make the HTTP requests to an App Proxy URL specifically: