Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/segment-boneyard/metrics-stripe-subscriptions
Visualize your Stripe subscriptions and MRR over time on a dashboard.
https://github.com/segment-boneyard/metrics-stripe-subscriptions
Last synced: about 5 hours ago
JSON representation
Visualize your Stripe subscriptions and MRR over time on a dashboard.
- Host: GitHub
- URL: https://github.com/segment-boneyard/metrics-stripe-subscriptions
- Owner: segment-boneyard
- Created: 2014-03-07T22:21:33.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-01-30T22:54:23.000Z (almost 10 years ago)
- Last Synced: 2024-11-11T07:46:04.852Z (5 days ago)
- Language: JavaScript
- Size: 249 KB
- Stars: 13
- Watchers: 37
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# metrics-stripe-subscriptions
A [Stripe](https://stripe.com) [subscriptions](https://github.com/stripe-subscriptions) plugin for [segmentio/metrics](https://github.com/segmentio/metrics).
Use this plugin to visualize Stripe subscriptions over time.
![](https://f.cloud.github.com/assets/658544/2361169/09325510-a62e-11e3-8f49-e327e89595cd.png)
## Installation
$ npm install metrics-stripe-subscriptions
## Quickstart
Here's a full example of a [Geckoboard](https://github.com/segmentio/geckoboard) dashboard showing Stripe subscription metrics:
```js
var Metrics = require('metrics');
var subscriptions = require('metrics-stripe-subscriptions');
var geckoboard = require('geckoboard')('api-key');new Metrics()
.every('10m', subscriptions('stripe-key'))
.use(function (metrics) {
metrics.on('stripe subscriptions today', geckboard('widget-id').number);
});
```#### Filter Customers
You can further `filter` customers using [stripe-subscriptions](https://github.com/segmentio/stripe-chages) filters:
```js
new Metrics()
.every('10m', subscriptions('stripe-key', { filter: filter }))function filter (customer) {
return customer.id !== 'cus_8239d2jd9j'; // filter enterprise customer X
}
```## Metrics
The metrics exposed by this plugin are:
- `stripe subscriptions` - the number of subscriptions
- `stripe subscriptions mrr` - the monthly recurring revenue amount representing the subscriptionsand are calculated for the last 30 days, last 52 weeks, and last 10 years.
## License
MIT