npm install reshuffle-mixpanel-connector
ES6 import: import { MixpanelConnector } from 'reshuffle-mixpanel-connectors'
This is a Reshuffle connector that provides an Interface to the Mixpanel Platform.
This connector uses Mixpanel node package.
const { Reshuffle } = require('reshuffle')
const { MixpanelConnector } = require('reshuffle-mixpanel-connector')
const app = new Reshuffle()
const mixpanelConnector = new MixpanelConnector(app, {
token: '<mixpanel-token>',
secret: '<mixpanel-secret>',
})
mixpanelConnector.track('test', { key1: 'value1', key2: 'value2' })
N/A
SDK - Get a Mixpanel client
Follow the instructions here
export interface MixpanelConnectorConfigOptions {
token: string
secret: string
}
Example:
const { Reshuffle } = require('reshuffle')
const { MixpanelConnector } = require('reshuffle-mixpanel-connector')
const app = new Reshuffle()
const mixpanelConnector = new MixpanelConnector(app, {
token: '<mixpanel-token>',
secret: '<mixpanel-secret>',
})
N/A
For tracking events
track(eventName: string, properties?: Record<string, any>): void
For importing events
import(eventName: string, time: Date | number, properties?: Record<string, any>): void
Returns a Mixpanel client (See details on npm)
sdk() : Mixpanel.Mixpanel
See Mixpanel.Mixpanel class in Mixpanel Node type
Example using the sdk:
const { Reshuffle } = require('reshuffle')
const { MixpanelConnector } = require('reshuffle-mixpanel-connector')
const app = new Reshuffle()
const mixpanelConnector = new MixpanelConnector(app, {
token: '<mixpanel-token>',
secret: '<mixpanel-secret>',
})
mixpanelConnector.sdk().import('action', Date.now())