Add sentry front-end tracking

This commit is contained in:
Julien Nahum
2023-10-08 13:35:15 +01:00
parent 54f92f844f
commit 23e323af95
8 changed files with 229 additions and 181 deletions

View File

@@ -4,6 +4,7 @@ import Meta from 'vue-meta'
import routes from './routes'
import Router from 'vue-router'
import {sync} from 'vuex-router-sync'
import * as Sentry from '@sentry/vue'
Vue.use(Meta)
Vue.use(Router)
@@ -49,6 +50,11 @@ function createRouter () {
* @param {Function} next
*/
async function beforeEach (to, from, next) {
// Sentry tracking
if (window.config.sentry_dsn) {
Sentry.configureScope((scope) => scope.setTransactionName(to?.name || 'Unknown route name'))
}
let components = []
// External redirect