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:
parent
8de4ce0037
commit
4759730022
12 changed files with 125 additions and 39 deletions
|
@ -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 => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue