Factor out Sentry URLs and set Sentry environment

This commit is contained in:
Jade Ellis
2024-08-27 18:51:11 +01:00
parent 687733bf7d
commit 8fbab1f87c
8 changed files with 21 additions and 9 deletions
+2 -1
View File
@@ -1,7 +1,8 @@
import { init as initSentry, handleErrorWithSentry, makeBrowserOfflineTransport, makeFetchTransport } from '@sentry/sveltekit';
initSentry({
dsn: 'https://d006c73cc53783930a1521a68ae1c312@o4507835405369344.ingest.de.sentry.io/4507835410481232',
dsn: import.meta.env.SENTRY_DSN,
environment: import.meta.env.MODE,
tracesSampleRate: 1.0,
// This sets the sample rate to be 10%. You may want this to be 100% while
+3 -2
View File
@@ -4,7 +4,8 @@ import type { Handle } from "@sveltejs/kit";
import { randomBytes } from 'crypto';
initSentry({
dsn: "https://d006c73cc53783930a1521a68ae1c312@o4507835405369344.ingest.de.sentry.io/4507835410481232",
dsn: import.meta.env.SENTRY_DSN,
environment: import.meta.env.MODE,
tracesSampleRate: 1
})
@@ -20,7 +21,7 @@ const securityHeaders = {
'Cross-Origin-Opener-Policy': 'same-origin',
'Cross-Origin-Resource-Policy': 'same-origin',
'Report-To': '{"group":"csp-endpoint","max_age":10886400,"endpoints":[{"url":"https://o4507835405369344.ingest.de.sentry.io/api/4507835410481232/security/?sentry_key=d006c73cc53783930a1521a68ae1c312"}],"include_subdomains":true}',
'Report-To': '{"group":"csp-endpoint","max_age":10886400,"endpoints":[{"url":"' + import.meta.env.SENTRY_REPORT_URL + '"}],"include_subdomains":true}',
}
export const handle: Handle = async (input) => {