mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 03:57:52 +00:00
feat: Configure Chatwoot & Analytics for SaaS app (#2975)
* feat: Add Chatwoot support inside Chatwoot SaaS * Fix identity issues with Chatwoot
This commit is contained in:
@@ -34,6 +34,11 @@ import {
|
||||
import * as Sentry from '@sentry/vue';
|
||||
import 'vue-easytable/libs/theme-default/index.css';
|
||||
import { Integrations } from '@sentry/tracing';
|
||||
import posthog from 'posthog-js';
|
||||
import {
|
||||
initializeAnalyticsEvents,
|
||||
initializeChatwootEvents,
|
||||
} from '../dashboard/helper/scriptHelpers';
|
||||
|
||||
Vue.config.env = process.env;
|
||||
|
||||
@@ -45,6 +50,12 @@ if (window.errorLoggingConfig) {
|
||||
});
|
||||
}
|
||||
|
||||
if (window.analyticsConfig) {
|
||||
posthog.init(window.analyticsConfig.token, {
|
||||
api_host: window.analyticsConfig.host,
|
||||
});
|
||||
}
|
||||
|
||||
Vue.use(VueRouter);
|
||||
Vue.use(VueI18n);
|
||||
Vue.use(WootUiKit);
|
||||
@@ -75,6 +86,9 @@ commonHelpers();
|
||||
window.WootConstants = constants;
|
||||
window.axios = createAxios(axios);
|
||||
window.bus = new Vue();
|
||||
initializeChatwootEvents();
|
||||
initializeAnalyticsEvents();
|
||||
|
||||
window.onload = () => {
|
||||
window.WOOT = new Vue({
|
||||
router,
|
||||
@@ -85,6 +99,7 @@ window.onload = () => {
|
||||
}).$mount('#app');
|
||||
vueActionCable.init();
|
||||
};
|
||||
|
||||
window.addEventListener('load', () => {
|
||||
verifyServiceWorkerExistence(registration =>
|
||||
registration.pushManager.getSubscription().then(subscription => {
|
||||
|
||||
Reference in New Issue
Block a user