add sentry

This commit is contained in:
Daniel Bulant 2022-12-12 13:40:25 +01:00
parent 0a157ca3c3
commit e955149f80
2 changed files with 10 additions and 0 deletions

View file

@ -27,6 +27,7 @@
"vite-plugin-windicss": "^1.8.8" "vite-plugin-windicss": "^1.8.8"
}, },
"dependencies": { "dependencies": {
"@sentry/browser": "^7.25.0",
"fflate": "^0.6.10", "fflate": "^0.6.10",
"streamsaver": "^2.0.6", "streamsaver": "^2.0.6",
"svelte-local-storage-store": "^0.3.1", "svelte-local-storage-store": "^0.3.1",

View file

@ -2,8 +2,17 @@
import { afterNavigate } from "$app/navigation"; import { afterNavigate } from "$app/navigation";
import { logs } from "$lib/util/logs"; import { logs } from "$lib/util/logs";
import PageTransition from "./pageTransition.svelte"; import PageTransition from "./pageTransition.svelte";
import * as Sentry from '@sentry/browser';
export var data; export var data;
if (browser && !dev && import.meta.env.VITE_SENTRY_DSN) {
Sentry.init({
dsn: import.meta.env.VITE_SENTRY_DSN,
environment: import.meta.env.VITE_SENTRY_ENVIRONMENT,
release: import.meta.env.VITE_SENTRY_RELEASE,
});
}
let skipFirst = true; let skipFirst = true;
let last = typeof window !== "undefined" && window.location.pathname; let last = typeof window !== "undefined" && window.location.pathname;