Skip to content
This repository was archived by the owner on Jan 23, 2021. It is now read-only.

Commit 224e10f

Browse files
Support to verify Webhook signatures
- Add `signingSecret` configuration to `config.sample.js` - Add verification path to Webhooks express server to verify signatures - Add documentation for `signingSecret` - Update some outdated, vulnerable dependencies
1 parent b8fc253 commit 224e10f

File tree

5 files changed

+658
-587
lines changed

5 files changed

+658
-587
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ Webhooks require a public URL that Stripe will ping to notify the monitor of new
3131

3232
If you have a [__Basic__](https://ngrok.com/pricing) ngrok subscription, you can specify a custom subdomain that will stay reserved for your account.
3333

34+
#### Optional: Verify Webhooks are signed
35+
[Stripe can optionally sign Webhook events to your endpoints](https://stripe.com/docs/webhooks/signatures). If you'd like the Webhook Monitor to verify these for you, simply modify the `signingSecret` value in `config.js` with the endpoint-specific signing secret key found at the bottom of the Webhook details page.
36+
37+
Unverified Webhooks will return a `400` response to Stripe, and log an error to your console.
38+
3439
### Start receiving changes
3540

3641
To start the monitor:

config.sample.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ module.exports = {
44
port: 4000,
55
stripe: {
66
// Include your Stripe secret key here
7-
secretKey: 'YOUR_STRIPE_SECRET_KEY'
7+
secretKey: 'YOUR_STRIPE_SECRET_KEY',
8+
signingSecret: null
89
},
910
/*
1011
Stripe needs a public URL for our server that it can ping with new events.

0 commit comments

Comments
 (0)