Open zirkelc opened 1 month ago
Hi there 👋
Thank you for this! There are some webhook changes coming down the pipe, and we are looking to make some improvements in this area. I am going to flag this with the rest of the team, and we will be keeping this in consideration!
Overview
The
shopifyApp()
function acceptswebhooks
on initialization. These webhooks can then be registered inafterAuth()
:This works for static webhook where the callback URL or AWS event source is static and available on initialization. In my case, the webhook callback URLs depend on values that I first receive after authorization when I have a valid session.
In this case, I cannot use the static
webhooks
object onshopifyApp()
. Instead, I create a secondshopifyApp()
object inside theafterAuth
which I use to register the webhooks:It would be nice if there were another option to add webhooks to the
shopifyApp()
instance after it was created. For example, the instance could a expose thewebhooks
object so that we can add additional webhooks inafterAuth()
OR theshopify.registerWebhooks()
function could accept an optional object with webhooks to register: