metrics-stripe-charges
A Stripe charges plugin for segmentio/metrics.
Use this plugin to visualize Stripe charges over time.
Installation
$ npm install metrics-stripe-charges
Quickstart
Here's a full example of a Geckoboard dashboard showing Stripe charge metrics:
var Metrics = require('metrics');
var charges = require('metrics-stripe-charges');
var geckoboard = require('geckoboard')('api-key');
new Metrics()
.every('10m', charges('stripe-key'))
.use(function (metrics) {
metrics.on('stripe charged today', geckoboard('widget-id').number);
});
Filter Customers
You can further filter
customers using stripe-charges filters:
new Metrics()
.every('10m', charges('stripe-key', { filter: filter }));
function filter (charge) {
return charge.customer !== 'cus_8239d2jd9j';
}
Metrics
The metrics exposed by this plugin are divided by date granularity.
Daily:
stripe charges today
- the number of charges todaystripe charged today
- the amount charged todaystripe charges yesterday
- the number of charges yesterdaystripe charged yesterday
- the amount charged yesterdaystripe charges 2 days ago
- the number of charges 2 days agostripe charged 2 days ago
- the amount charged 2 days ago
Weekly:
stripe charges past week
- the number of charges last weekstripe charged past week
- total charged last weekstripe charges 2 weeks ago
- the number of charges 2 weeks agostripe charged 2 weeks ago
- total charged 2 weeks ago
Monthly:
stripe charges past month
- the number of charges last monthstripe charged past month
- total charged last monthstripe charges 2 months ago
- the number of charges 2 months agostripe charged 2 months ago
- total charged 2 months ago
Total:
stripe charges
- total amount of Stripe chargesstripe charged
- total amount charged
Weekly Sparkline:
stripe charges last week
- an array of charges in the past 7 daysstripe charged last week
- an array of charge amounts in the past 7 days
License
MIT