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

Commit 26dffbe

Browse files
committed
Initial commit.
0 parents  commit 26dffbe

18 files changed

+6521
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
config.js
3+
npm-debug.log
4+
.DS_Store

README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Stripe Webhook Monitor
2+
3+
`stripe-webhook-monitor` is a real-time monitor for Stripe webhooks that provides a live feeds and graph of recent events.
4+
5+
<img src="https://raw.githubusercontent.com/stripe/stripe-webhook-monitor/master/screenshots/monitor-feed.gif" width="425"> <img src="https://raw.githubusercontent.com/stripe/stripe-webhook-monitor/master/screenshots/monitor-graph.gif" width="425">
6+
7+
Stripe's platform includes [webhooks](https://stripe.com/docs/webhooks) that will notify you when actions take place on your account. For example, you can be notified when:
8+
9+
- New charges are created (`charge.created`)
10+
- Customers subscribe to a new plan (`customer.subscription.created`)
11+
- Payouts and transfers are completed (`payout.paid`)
12+
- An invoice payment failed (`invoice.payment_failed`)
13+
14+
Webhooks are powerful: you can subscribe to these notifications and programmatically react to them in real-time.
15+
16+
## Getting started
17+
18+
### Set up the monitor
19+
Clone the project repository, and create a configuration for your Stripe account:
20+
21+
```
22+
cp config.sample.js config.js
23+
```
24+
25+
You'll need to fill in your Stripe secret key.
26+
27+
Webhooks require a public URL that Stripe will ping to notify the monitor of new events. Support for [ngrok](https://ngrok.com/) is included out of the box: ngrok will create a secure tunnel and provide a public URL to your local machine.
28+
29+
If you have a [__Basic__](https://ngrok.com/pricing) ngrok subscription, you can specify a custom subdomain that will stay reserved for your account.
30+
31+
### Start receiving changes
32+
33+
To start the monitor:
34+
35+
```
36+
npm install
37+
npm start
38+
```
39+
40+
Take note of the public URL provided by ngrok: it should be listed when the monitor starts.
41+
42+
**Don't want to use ngrok?** As long as Stripe can reach the webhooks endpoint via a public URL, you'll receive updates.
43+
44+
### Subscribe to webhook notifications
45+
46+
In your Stripe Dashboard, go to the _API_ section, then click on the _Webhooks_ tab.
47+
48+
You should add a receiving endpoint by clicking _Add Endpoint_. Fill in the public URL provided by ngrok, or any other public URL that can reach the webhook monitor.
49+
50+
![](https://raw.githubusercontent.com/stripe/stripe-webhook-monitor/master/screenshots/setting-up-webhooks.png)
51+
52+
## Troubleshooting
53+
54+
### I'm not receiving real-time updates
55+
56+
- Check that the [Stripe Dashboard](https://dashboard.stripe.com/webhooks/) is listing your webhook route as _Enabled_.
57+
- Make sure that the webhook endpoint matches the URL printed in your console.
58+
59+
## Credits
60+
61+
- Code: [Michael Glukhovsky](https://twitter.com/mglukhovsky)
62+
- Icons: [Ionicons](http://ionicons.com/)

config.sample.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
'use strict';
2+
3+
module.exports = {
4+
port: 4000,
5+
stripe: {
6+
// Include your Stripe secret key here
7+
secretKey: 'YOUR_STRIPE_SECRET_KEY'
8+
},
9+
/*
10+
Stripe needs a public URL for our server that it can ping with new events.
11+
If ngrok is enabled, this server will create a public endpoint for you.
12+
*/
13+
ngrok: {
14+
enabled: true,
15+
/*
16+
Optional: if you have a Pro ngrok account you can provide a custom
17+
subdomain and your authentication token here.
18+
*/
19+
subdomain: null,
20+
authtoken: null
21+
}
22+
}

0 commit comments

Comments
 (0)