mixpanel-react-native
Version:
Official React Native Tracking Library for Mixpanel Analytics
16 lines (11 loc) • 494 B
JavaScript
import {Mixpanel} from 'mixpanel-react-native';
import {token as MixpanelToken, trackAutomaticEvents} from './app.json';
export class MixpanelManager {
static sharedInstance = MixpanelManager.sharedInstance || new MixpanelManager();
constructor() {
this.mixpanel = new Mixpanel(MixpanelToken, trackAutomaticEvents);
this.mixpanel.init();
this.mixpanel.setLoggingEnabled(true);
}
}
export const MixpanelInstance = MixpanelManager.sharedInstance.mixpanel;