Hi all,
I am developing a Shopify app using Theme App Extensions and I want to handle multiple API calls using the App Proxy feature. Currently, I am directly using the app URL to fetch data, like so:
fetch(${appUrl}/api/wishlist?customerId=${customerId}&productId=${productId}&shop=${shop}&variantId=${variantId});
fetch(${appUrl}/api/plpwishlist?customerId=${customerId}&shop=${shop}&productIds=${productIds.join(',')});
const wishlistRes = await fetch(${appUrl}/api/getwishlist?customerId=${customerId}&shop=${shop});
const tagRes = await fetch(${appUrl}/api/getProductTags?shop=${shop});
I want to implement this using the App Proxy feature in Shopify, so the app URL is not exposed to the client. How should I go about handling this? Specifically, I need to:
Ensure the API calls are routed through the App Proxy to hide the backend API URL.
Properly manage the API endpoints for multiple requests.
Could someone guide me on how to configure this correctly with App Proxy?