Focuses on API authentication, access scopes, and permission management.
The documentation at: https://shopify.dev/docs/apps/online-store/app-proxies mentions that "Merchants can change the sub path or sub path prefix of app proxies.". How can an app determine the current setting of the app proxy for that store?
For example:
Given a theme extension needs to read data from the proxied app.
The App is configured with:
Subpath Prefix: apps
Subpath: blah
The merchant installs the app and changes the configuration to:
Subpath Prefix: {storeurl}/tools
Subpath: halb
How does the theme code find the {storeurl}/tools/halb path it would need to POST to or GET from?
Hey @minsko,
I doesn't look like there's an API to determine which subpath a merchant selects. Changes would need to be done manually in your example.
Scott | Developer Advocate @ Shopify
Can an API be added to get this information? The only workaround I see would be for apps to add a new section to their administration pages asking the merchant to re-enter the customized path.
Hey @minsko
Happy to send the feedback to the app proxy team. Can you elaborate on your use case? Say a merchant changed the sub-path, how would you use the information? Would you update the theme? and in this case could you do this programatically, or would you need to manually update?
Scott | Developer Advocate @ Shopify
I am working on a theme extension that needs to contact the app server to get information to display to the user. My understanding is this is one of the main reasons to use an App Proxy. The theme extension needs to know the path that will get proxied to the app server. By default, the theme extension uses the path defined for the app (/apps/blah). If the merchant customizes the path (/tools/hlab), the theme extension will no longer be able to use the app proxy as it does not know the path that is proxied. If this information was available to the app and theme extension, it could be used to programmatically determine the proxied path.
Any improvements for this scenario. I have been struggling quite a long time with this problem. The only workaround seems to prompt the merchant to add the proxy URL somewhere in my App so I can store/udate in an app metafield that can be read by my theme extension's liquid.
Its a long path and not an ideal one to force the merchant to remember changing the proxy URL in the app config when it changes...
Any webhooks that fire when this config is changed? Any GrapQL API query/mutation to manage proxies?
Thanks a lot!