Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/segment-boneyard/metrics-stripe-charges
Visualize Stripe charges over time.
https://github.com/segment-boneyard/metrics-stripe-charges
Last synced: about 5 hours ago
JSON representation
Visualize Stripe charges over time.
- Host: GitHub
- URL: https://github.com/segment-boneyard/metrics-stripe-charges
- Owner: segment-boneyard
- Created: 2014-03-07T22:43:53.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-01-16T00:01:27.000Z (almost 10 years ago)
- Last Synced: 2024-11-11T03:52:48.715Z (5 days ago)
- Language: JavaScript
- Size: 211 KB
- Stars: 9
- Watchers: 37
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# metrics-stripe-charges
A [Stripe](https://stripe.com) [charges](https://github.com/stripe-charges) plugin for [segmentio/metrics](https://github.com/segmentio/metrics).
Use this plugin to visualize Stripe charges over time.
![](https://f.cloud.github.com/assets/658544/2361169/09325510-a62e-11e3-8f49-e327e89595cd.png)
## Installation
$ npm install metrics-stripe-charges
## Quickstart
Here's a full example of a [Geckoboard](https://github.com/segmentio/geckoboard) dashboard showing Stripe charge metrics:
```js
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', function (metric) {
geckoboard('widget-id').number(metric.latest());
});
});
```#### Filter Customers
You can further `filter` customers using [stripe-charges](https://github.com/segmentio/stripe-chages) filters:
```js
new Metrics()
.every('10m', charges('stripe-key', { filter: filter }));function filter (charge) {
return charge.customer !== 'cus_8239d2jd9j'; // filter enterprise customer X
}
```## Metrics
The metrics exposed by this plugin are:
- `stripe charges` - the number of charges
- `stripe charged` - the dollar amount chargedand are calculated for the last 30 days, last 52 weeks, and last 10 years.
## License
MIT