feat: Integrate LogRocket (#6494)

* feat: install logrocket

* feat: allow log rocket

* feat: enable vuex log-rocket

* feat: integrate vuex with log rocket

* feat: add log rocket identify

* fix: identify if log rocket is initialized

---------

Co-authored-by: Vishnu Narayanan <vishnu@chatwoot.com>
This commit is contained in:
Shivam Mishra
2023-02-21 08:42:45 +05:30
committed by GitHub
co-authored by Vishnu Narayanan
parent 26f164d6a0
commit 62de25960c
6 changed files with 43 additions and 0 deletions
@@ -1,4 +1,5 @@
import AnalyticsHelper from './AnalyticsHelper';
import LogRocket from 'logrocket';
import DashboardAudioNotificationHelper from './AudioAlerts/DashboardAudioNotificationHelper';
export const CHATWOOT_SET_USER = 'CHATWOOT_SET_USER';
@@ -10,6 +11,12 @@ export const ANALYTICS_RESET = 'ANALYTICS_RESET';
export const initializeAnalyticsEvents = () => {
window.bus.$on(ANALYTICS_IDENTITY, ({ user }) => {
AnalyticsHelper.identify(user);
if (window.logRocketProjectId) {
LogRocket.identify(user.id, {
email: user.email,
name: user.name,
});
}
});
window.bus.$on(ANALYTICS_RESET, () => {});
};