Hello,
I’m new to Shopify apps and want to make sure I’m doing things right. I created a sales channel app using the Remix App Template provided by Shopify. The documentation explains how to add webhooks to the app, but it does not mentioned anything about removing webhooks upon uninstall. Does this mean, that the app will remove webhooks appearing in the configuration automatically when a shop uninstalls my app?
My configuration looks like this:
const shopify = shopifyApp({
<[snip]>
webhooks: {
APP_UNINSTALLED: {
deliveryMethod: DeliveryMethod.Http,
callbackUrl: "/webhooks"
},
BULK_OPERATIONS_FINISH: {
deliveryMethod: DeliveryMethod.Http,
callbackUrl: "/webhooks"
}
},
hooks: {
afterAuth: async ({ session }) => {
shopify.registerWebhooks({ session })
}
},
future: {
v3_webhookAdminContext: true,
v3_authenticatePublic: true
}
<[snip]>
})
The webhooks work as expected. I even tried deleting webhooks in the APP_UNINSTALLED webhook handler, but the session’s access token is already marked invalid at that time and won’t allow any further Admin API calls.
If the app does not unregister/delete the configured webhooks and I must clean them up myself, how and when should this process happen?
Thank you for any pointers!