Solved

Do apps using the Remix template need to delete configured webhooks?

guidoAF
Shopify Partner
4 1 0

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 app hooks 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!

 

Accepted Solution (1)

guidoAF
Shopify Partner
4 1 0

This is an accepted solution.

Sorry for the duplicate. I reposted in the correct forum, but don't see an option to remove a post. This question was answered here:

https://community.shopify.com/c/partners-discussion/do-apps-using-the-remix-template-need-to-delete-...  

View solution in original post

Reply 1 (1)

guidoAF
Shopify Partner
4 1 0

This is an accepted solution.

Sorry for the duplicate. I reposted in the correct forum, but don't see an option to remove a post. This question was answered here:

https://community.shopify.com/c/partners-discussion/do-apps-using-the-remix-template-need-to-delete-...