reshuffle-mixpanel-connector
v0.0.2
Published
A Reshuffle MixPanel connector
Downloads
4
Maintainers
Readme
Reshuffle Mixpanel Connector
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.
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>',
})
mixpanelConnector.track('test', { key1: 'value1', key2: 'value2' })
Table of Contents
Connector Events
N/A
Connector Actions
SDK - Get a Mixpanel client
Setup Mixpanel
Follow the instructions here
Configuration Options
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>',
})
Connector events
N/A
Track
For tracking events
track(eventName: string, properties?: Record<string, any>): void
Import
For importing events
import(eventName: string, time: Date | number, properties?: Record<string, any>): void
SDK
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())