Shopify / shopify-app-js

MIT License
262 stars 101 forks source link

Being able to disable webhook handling #748

Open LouiseEH opened 5 months ago

LouiseEH commented 5 months ago

Overview

We are developing an app where each merchant might use a different set of webhooks, depending on which features of the app they use. When shopifyApp.auth.path (/api/auth) is called, the app registers webhooks that are defined in the app and deletes all other webhooks. But as the number of webhooks to be registered differs from merchant to merchant, we cannot statically define a set of webhooks for all merchants that use the app. For this reason it would be great if we could disable the webhook handling in shopify-app-js, so we can implement a custom webhook handling instead. Currently all of our registered webhooks will be removed when shopifyApp.auth.path (/api/auth) is called which happens e.g. when the merchant gets a new browser session (the merchant closes their browser and opens a new browser and access the app again).

I tried with the following, but it seems to be overridden:

image

The following does not work either:

image

The issue seems to be (at least, not limited to) that registerWebhooks is called on authCallback:

image

Kind regards, -Louise

LouiseEH commented 5 months ago

OK as a workaround I can override shopify.api.webhooks.register:

image
matteodepalo commented 5 months ago

Hi @LouiseEH thank you for opening the issue and for providing a workaround, we'll take a look 👍

github-actions[bot] commented 3 months ago

We're labeling this issue as stale because there hasn't been any activity on it for 60 days. While the issue will stay open and we hope to resolve it, this helps us prioritize community requests.

You can add a comment to remove the label if it's still relevant, and we can re-evaluate it.

github-actions[bot] commented 4 weeks ago

We're labeling this issue as stale because there hasn't been any activity on it for 60 days. While the issue will stay open and we hope to resolve it, this helps us prioritize community requests.

You can add a comment to remove the label if it's still relevant, and we can re-evaluate it.