enable sentry

This commit is contained in:
Cat /dev/Nulo 2024-09-14 12:06:36 -03:00
parent 84dda9b7e8
commit 2ac54f25f6
6 changed files with 47 additions and 1 deletions

Binary file not shown.

View file

@ -19,3 +19,6 @@ Thumbs.db
# Vite # Vite
vite.config.js.timestamp-* vite.config.js.timestamp-*
vite.config.ts.timestamp-* vite.config.ts.timestamp-*
# Sentry Config File
.sentryclirc

View file

@ -40,6 +40,7 @@
}, },
"type": "module", "type": "module",
"dependencies": { "dependencies": {
"@sentry/sveltekit": "^8.30.0",
"@types/node": "^22.5.0", "@types/node": "^22.5.0",
"bits-ui": "^0.21.13", "bits-ui": "^0.21.13",
"clsx": "^2.1.1", "clsx": "^2.1.1",

View file

@ -0,0 +1,12 @@
import { handleErrorWithSentry } from '@sentry/sveltekit';
import * as Sentry from '@sentry/sveltekit';
if (import.meta.env.PROD) {
Sentry.init({
dsn: 'https://1177c12a82e0a16aeb1b637bcf392f20@o4507188153548800.ingest.de.sentry.io/4507951835447376',
tracesSampleRate: 1.0
});
}
// If you have a custom error handler, pass it to `handleErrorWithSentry`
export const handleError = handleErrorWithSentry();

View file

@ -0,0 +1,20 @@
import { sequence } from '@sveltejs/kit/hooks';
import { handleErrorWithSentry, sentryHandle } from '@sentry/sveltekit';
import * as Sentry from '@sentry/sveltekit';
if (import.meta.env.PROD) {
Sentry.init({
dsn: 'https://1177c12a82e0a16aeb1b637bcf392f20@o4507188153548800.ingest.de.sentry.io/4507951835447376',
tracesSampleRate: 1.0
// uncomment the line below to enable Spotlight (https://spotlightjs.com)
// spotlight: import.meta.env.DEV,
});
}
// If you have custom handlers, make sure to place them after `sentryHandle()` in the `sequence` function.
export const handle = sequence(sentryHandle());
// If you have a custom error handler, pass it to `handleErrorWithSentry`
export const handleError = handleErrorWithSentry();

View file

@ -1,6 +1,16 @@
import { sentrySvelteKit } from '@sentry/sveltekit';
import { sveltekit } from '@sveltejs/kit/vite'; import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite'; import { defineConfig } from 'vite';
export default defineConfig({ export default defineConfig({
plugins: [sveltekit()] plugins: [
sentrySvelteKit({
sourceMapsUploadOptions: {
org: 'nulo-inc',
project: 'preciazo-sitio2',
url: 'https://sentry.io/'
}
}),
sveltekit()
]
}); });