node-mixpanel-data-exporter

Wrapper for Mixpanel Data API

npm install node-mixpanel-data-exporter
1 downloads in the last day
10 downloads in the last week
45 downloads in the last month

node-mixpanel-data-exporter

This provides a wrapper to Mixpanel's Data Export API

Quick Start

Initialize

  //initialize with required api_key and api_secret
  var Mixpanel_Exporter = require('./mixpanel_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](https://mixpanel.com/docs/api-documentation/data-export-api#top-endpoints)
  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) {

  })

Tests

  make
npm loves you