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:
Pranav Raj S 2021-09-07 23:11:01 +05:30 committed by GitHub
parent 8de4ce0037
commit 4759730022
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 125 additions and 39 deletions

View file

@ -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 => {