Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Commit

Permalink
Add documentation for how to register eventbridge and pubsub webhooks
Browse files Browse the repository at this point in the history
  • Loading branch information
tbrenev committed May 17, 2021
1 parent b30a042 commit 979435e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/usage/webhooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,20 @@ app.get('/auth/callback', async (req, res) => {
```
</details>
### EventBridge and PubSub Webhooks
You can also register webhooks for delivery to Amazon EventBridge or Google Cloud
Pub/Sub. In this case the `path` argument to
`Shopify.Webhooks.Registry.register` needs to be of a specific form.
For EventBridge, the `path` must be the [ARN of the partner event
source](https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_EventSource.html).
For Pub/Sub, the `path` must be of the form
`pubsub://[PROJECT-ID]:[PUB-SUB-TOPIC-ID]`. For example, if you created a topic
with id `red` in the project `blue`, then the value of `path` would be
`pubsub://red:blue`.

## Process a Webhook

To process a webhook, you need to listen on the route(s) you provided during the Webhook registration process, then call the appropriate handler. The library provides a convenient `process` method that acts as a middleware to handle webhooks. It takes care of calling the correct handler for the registered Webhook topics.
Expand Down

0 comments on commit 979435e

Please # to comment.