Delete files from themes after App/Uninstalled webhook is received

viveksolanki
Tourist
11 0 1

When I receive an App/Uninstalled, one of the things I need to do is revert the changes that I have done in files "theme.liquid","search.liquid","cart-template.liquid","product-template.liquid" and there are two more files that I need to delete. But as we know that after App/Uninstalled the access_token becomes invalid. Now I am getting an Error 401, that the Token is Unauthorized. While this makes sense, how can I revert and delete files for a theme

0 Likes
Gavinator
Shopify Partner
1250 6 96

You can use a strategy of seeing if the scripttag your App previously added is still in play: https://www.shopify.com/partners/blog/add-code-from-your-app Coupled with the ability to use the Shopify CDN to proxy your scripts I'd say this is the best way to tackle it at this time.

HTH, Gavin.

www.bookthatapp.com
0 Likes