Skip to content

Commit

Permalink
Load sentry if dsn is setup
Browse files Browse the repository at this point in the history
  • Loading branch information
karlomikus committed Dec 18, 2024
1 parent 47248ec commit 28b0031
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 0 deletions.
1 change: 1 addition & 0 deletions docker/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ window.srConfig.BILLING_ENABLED = "$BILLING_ENABLED" === 'true';
window.srConfig.BILLING_ENV = "$BILLING_ENV";
window.srConfig.ANALYTICS_HOST = "$ANALYTICS_HOST";
window.srConfig.ALLOW_REGISTRATION = "$ALLOW_REGISTRATION";
window.srConfig.SENTRY_DSN = "$SENTRY_DSN";
91 changes: 91 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"@floating-ui/vue": "^1.1.5",
"@meilisearch/instant-meilisearch": "^1.0.0",
"@paddle/paddle-js": "^1.2.1",
"@sentry/vue": "^8.47.0",
"@types/sortablejs": "^1.15.8",
"@vueuse/core": "^11.0.3",
"cropperjs": "^1.6.1",
Expand Down
11 changes: 11 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import AppState from './AppState.js'
import Plausible from 'plausible-tracker'
import { registerSW } from 'virtual:pwa-register'
import { register as registerSwiperElements } from 'swiper/element/bundle'
import * as Sentry from "@sentry/vue";

import en_US from './locales/en-US'
import hr_HR from './locales/hr-HR'
Expand Down Expand Up @@ -45,6 +46,16 @@ if (userSelectedTheme == 'dark' && !document.body.classList.contains('dark-theme
}

const app = createApp(App)

if (window.srConfig.SENTRY_DSN && window.srConfig.SENTRY_DSN != '') {
Sentry.init({
app,
release: window.srConfig.VERSION,
dsn: window.srConfig.SENTRY_DSN,
integrations: [],
});
}

const i18n = createI18n({
legacy: false,
locale: userSelectedLocale,
Expand Down

0 comments on commit 28b0031

Please sign in to comment.