This provides a wrapper to Mixpanel's Data Export API
npm install node-mixpanel-data-exporter
Initialize
//initialize with required api_key and api_secret
var Mixpanel_Exporter = require('node-mixpanel-data-exporter')
, mixpanel_exporter = new Mixpanel_Exporter({
api_key: 'your api key'
, api_secret: 'your api secret'
, format: 'json' //optional and will default to json
})
Request to any of the API Methods
mixpanel_exporter.fetch('events', {
event: ['your event name']
, type: 'general'
, unit: 'minute'
...
}, function(error, request, body) {
})
If the API Method has a path, use the full path
mixpanel_exporter.fetch('events/top', {
type: 'general'
...
}, function(error, request, body) {
})
You can also call any of the methods directly
mixpanel_exporter.events({
event: ['your event name']
, type: 'general'
, unit: 'minute'
...
}, function(error, request, body) {
})
If the method has a forward slash, replace it with an underscore
mixpanel_exporter.events_top({
type: 'general'
...
}, function(error, request, body) {
})
make