I'm trying to make an app to use PWA in Shopify stores, and I'm having an issue to add service worker file automatically when a client install our app, I can't use Asset API as it uses Shopify CDN instead of store domain name, so instead i want to use app proxy (https://shopify.dev/tutorials/display-dynamic-store-data-with-app-proxies) it will work fine but we need the integration to be done automatically when a store install our app so my question is:
Is there an API to add an app proxy when a store installs our app ? or is there another solution to be able to integrate the service worker file in the store (JS file) via API ?
Hello @Kevin_A , Thank you for your answer.
When you create an App to install in a merchant store, you can choose to add extensions to it. One of the extensions is App Proxy. There is no API to setup a Proxy. Instead, it is all done in your Partner App setup.
Note that there are issues with Proxy that may or may not affect your use of ServiceWorkers. The Proxy is pretty good about stripping ALL nefarious or otherwise extras from calls in to the Proxy.