All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.initializers.mixpanel.js.map Maven / Gradle / Ivy

Go to download

A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.

There is a newer version: 4.12.3
Show newest version
{"version":3,"file":"mixpanel.js","names":["mixpanel","initializeMixpanel","skip","_globalProps$user","_globalProps$organiza","analyticsId","concat","globalProps","user","email","organization","subdomain","mixpanelProjectToken","_globalProps$user2","_globalProps$user3","_globalProps$user4","_globalProps$user5","_globalProps$organiza2","init","people","set","$first_name","firstName","$last_name","lastName","$email","identify"],"sources":["../../src/initializers/mixpanel.js"],"sourcesContent":["import mixpanel from \"mixpanel-browser\";\n\nexport default function initializeMixpanel(skip) {\n  const analyticsId = `${globalProps.user?.email}-${globalProps.organization?.subdomain}`;\n\n  if (globalProps.mixpanelProjectToken && !skip?.mixpanel) {\n    mixpanel.init(globalProps.mixpanelProjectToken);\n    mixpanel.people.set({\n      $first_name: globalProps.user?.firstName,\n      $last_name: globalProps.user?.lastName,\n      $email: globalProps.user?.email,\n      user: globalProps.user?.email,\n      subdomain: globalProps.organization?.subdomain,\n    });\n    mixpanel.identify(analyticsId);\n  } else {\n    /*\n  We need to initialize mixpanel with a bogus token in development and test environment to\n  prevent mixpanel library from throwing an error when we use mixpanel.track() method in react components.\n  */\n    mixpanel.init(\"TEST_TOKEN\");\n  }\n}\n"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,kBAAkB;AAEvC,eAAe,SAASC,kBAAkBA,CAACC,IAAI,EAAE;EAAA,IAAAC,iBAAA,EAAAC,qBAAA;EAC/C,IAAMC,WAAW,MAAAC,MAAA,EAAAH,iBAAA,GAAMI,WAAW,CAACC,IAAI,cAAAL,iBAAA,uBAAhBA,iBAAA,CAAkBM,KAAK,OAAAH,MAAA,EAAAF,qBAAA,GAAIG,WAAW,CAACG,YAAY,cAAAN,qBAAA,uBAAxBA,qBAAA,CAA0BO,SAAS,CAAE;EAEvF,IAAIJ,WAAW,CAACK,oBAAoB,IA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