A space to discuss online store customization, theme development, and Liquid templating.
Hello,
I am trying to figure out if a specific app in installed or not in liquid in order to provide access to the app proxy pages from within the theme only if an app is installed.
Ideally we would be able to check if an app is installed via something like {{ shop.apps.APP_NAME }}. I have tried setting this up by having my app add a metafield to the shop, however it is not possible to remove this metafield on uninstall since I no longer have access to metafields after uninstall.
Does anyone have anyway of detecting if an app is installed from within the liquid content in a theme?
Thank you,
-Andrew
A correct implementation of App Proxy usage implies you do not allow any incoming calls to the App Proxy if the App is not installed (unless you choose to serve all comers). Since all App Proxy calls include the shop details presenting the request to your Proxy, you can simply ignore calls to this App Proxy that are coming from a shop without the App installed.
No need to mess around as you are asking.
Hey HunkyBill,
Unfortunately I am not trying to detect this from an app proxy but instead use this in a theme to provide a link to an app proxy page(from a normal page) if the app containing the proxy is installed.
For example I would like to provide a link within the product.liquid template to an app proxy page related to this product but only if the app providing the proxy page is installed in the shop
Provide the link to anyone.. anytime... it does not hurt. Whenever a call comes in you do not want to service, send back nothing...
Hi Andrew,
Have you thought about having your App install a script tag? The script will be called only when the App is installed.
Gavin.
Have you got any ideas @Andrew
@chris. 2 perfect solutions presented here. What more could you want?