Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
logEvent: (event: EventType, data: any) => {
if (environment !== 'production') {
console.info('Event tracked', event, data);
return;
}
if (mixpanel.has_opted_out_tracking()) {
return;
}
mixpanel.track(event, data);
},
};