mirror of
https://github.com/LukeHagar/website.git
synced 2025-12-09 21:07:46 +00:00
fix: case when sentry auth token is not set
This commit is contained in:
@@ -1,11 +1,10 @@
|
|||||||
import { building } from '$app/environment';
|
import { building } from '$app/environment';
|
||||||
import { SENTRY_AUTH_TOKEN } from '$env/static/private';
|
|
||||||
import { SENTRY_DSN } from '$lib/constants';
|
import { SENTRY_DSN } from '$lib/constants';
|
||||||
import { handleErrorWithSentry, replayIntegration } from '@sentry/sveltekit';
|
import { handleErrorWithSentry, replayIntegration } from '@sentry/sveltekit';
|
||||||
import * as Sentry from '@sentry/sveltekit';
|
import * as Sentry from '@sentry/sveltekit';
|
||||||
|
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
enabled: !!SENTRY_AUTH_TOKEN && building,
|
enabled: !!import.meta.env?.SENTRY_AUTH_TOKEN && building,
|
||||||
dsn: SENTRY_DSN,
|
dsn: SENTRY_DSN,
|
||||||
tracesSampleRate: 1.0,
|
tracesSampleRate: 1.0,
|
||||||
|
|
||||||
|
|||||||
@@ -3,11 +3,10 @@ import type { Handle } from '@sveltejs/kit';
|
|||||||
import redirects from './redirects.json';
|
import redirects from './redirects.json';
|
||||||
import { sequence } from '@sveltejs/kit/hooks';
|
import { sequence } from '@sveltejs/kit/hooks';
|
||||||
import { BANNER_KEY, SENTRY_DSN } from '$lib/constants';
|
import { BANNER_KEY, SENTRY_DSN } from '$lib/constants';
|
||||||
import { SENTRY_AUTH_TOKEN } from '$env/static/private';
|
|
||||||
import { building } from '$app/environment';
|
import { building } from '$app/environment';
|
||||||
|
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
enabled: !!SENTRY_AUTH_TOKEN && building,
|
enabled: !!import.meta.env?.SENTRY_AUTH_TOKEN && building,
|
||||||
dsn: SENTRY_DSN,
|
dsn: SENTRY_DSN,
|
||||||
tracesSampleRate: 1
|
tracesSampleRate: 1
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user