Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
VITE_APP_DOMAIN_TARGET=
VITE_APPWRITE_ENDPOINT=
VITE_GOOGLE_ANALYTICS=
VITE_GOOGLE_ANALYTICS=
VITE_SENTRY_DSN=
228 changes: 221 additions & 7 deletions package-lock.json

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

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
"@aw-labs/icons": "0.0.0-76",
"@aw-labs/ui": "0.0.0-76",
"@popperjs/core": "^2.11.6",
"@sentry/svelte": "^7.19.0",
"@sentry/tracing": "^7.19.0",
"echarts": "^5.4.0",
"pretty-bytes": "^6.0.0",
"prismjs": "^1.29.0",
Expand Down
1 change: 1 addition & 0 deletions src/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
interface Window {
GOOGLE_ANALYTICS: string | false;
VERCEL_ANALYTICS_ID: string | false;
SENTRY_DSN: string | false;
}
14 changes: 14 additions & 0 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@
import { Progress, Notifications } from '$lib/layout';
import { loading } from './store';
import Loading from './loading.svelte';
import * as Sentry from '@sentry/svelte';
import { BrowserTracing } from '@sentry/tracing';

if (browser) {
window.VERCEL_ANALYTICS_ID = import.meta.env.VERCEL_ANALYTICS_ID?.toString() ?? false;
window.GOOGLE_ANALYTICS = import.meta.env.VITE_GOOGLE_ANALYTICS?.toString() ?? false;
window.SENTRY_DSN = import.meta.env.VITE_SENTRY_DSN?.toString() ?? false;
}

onMount(async () => {
Expand All @@ -30,6 +33,17 @@
onTTFB(reportWebVitals);
}

/**
* Sentry Error Logging
*/
if (!dev && window.SENTRY_DSN) {
Sentry.init({
dsn: window.SENTRY_DSN,
integrations: [new BrowserTracing()],
tracesSampleRate: 1.0
});
}

/**
* Handle initial load.
*/
Expand Down