Skip to content

Commit 9a4df27

Browse files
authored
Merge pull request #661 from MicroPyramid/sf_import
Sf import
2 parents ae947ba + d2e3d70 commit 9a4df27

5 files changed

Lines changed: 23 additions & 25 deletions

File tree

frontend/.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,8 @@ GOOGLE_LOGIN_DOMAIN="http://localhost:5173"
55
# Django API URL (PUBLIC_ prefix makes it available in both server and browser)
66
PUBLIC_DJANGO_API_URL=http://localhost:8000
77

8+
# Sentry (only set in production — omit locally to disable Sentry)
9+
# PUBLIC_SENTRY_DSN="https://your-dsn.ingest.sentry.io/your-project"
10+
811
# Environment
912
NODE_ENV=development

frontend/src/hooks.client.js

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,18 @@
11
import { handleErrorWithSentry, replayIntegration } from "@sentry/sveltekit";
22
import * as Sentry from '@sentry/sveltekit';
3+
import { env } from '$env/dynamic/public';
34

4-
Sentry.init({
5-
dsn: 'https://59bf64c93be48f6cd30087fef7bbc54f@o4509449489088512.ingest.de.sentry.io/4510910257496144',
5+
const dsn = env.PUBLIC_SENTRY_DSN || '';
66

7+
Sentry.init({
8+
dsn,
9+
enabled: !!dsn,
710
tracesSampleRate: 1.0,
8-
9-
// Enable logs to be sent to Sentry
1011
enableLogs: true,
11-
12-
// This sets the sample rate to be 10%. You may want this to be 100% while
13-
// in development and sample at a lower rate in production
1412
replaysSessionSampleRate: 0.1,
15-
16-
// If the entire session is not sampled, use the below sample rate to sample
17-
// sessions when an error occurs.
1813
replaysOnErrorSampleRate: 1.0,
19-
20-
// If you don't want to use Session Replay, just remove the line below:
2114
integrations: [replayIntegration()],
22-
23-
// Enable sending user PII (Personally Identifiable Information)
24-
// https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#sendDefaultPii
2515
sendDefaultPii: true,
2616
});
2717

28-
// If you have a custom error handler, pass it to `handleErrorWithSentry`
2918
export const handleError = handleErrorWithSentry();
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import * as Sentry from '@sentry/sveltekit';
2+
import { env } from '$env/dynamic/public';
23

3-
Sentry.init({
4-
dsn: 'https://59bf64c93be48f6cd30087fef7bbc54f@o4509449489088512.ingest.de.sentry.io/4510910257496144',
4+
const dsn = env.PUBLIC_SENTRY_DSN || '';
55

6+
Sentry.init({
7+
dsn,
8+
enabled: !!dsn,
69
tracesSampleRate: 1.0,
7-
8-
// Enable logs to be sent to Sentry
910
enableLogs: true,
10-
11-
// uncomment the line below to enable Spotlight (https://spotlightjs.com)
12-
// spotlight: import.meta.env.DEV,
1311
});

frontend/svelte.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import adapter from '@sveltejs/adapter-node';
33
const config = { kit: {
44
adapter: adapter(),
55

6+
version: {
7+
pollInterval: 60000
8+
},
9+
610
experimental: {
711
tracing: {
812
server: true

frontend/vite.config.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ import { defineConfig } from 'vite';
66
export default defineConfig({
77
plugins: [sentrySvelteKit({
88
org: "micropyramid-fa",
9-
project: "bottlecrm-app"
10-
}), tailwindcss(), sveltekit()]
9+
project: "bottlecrm-app",
10+
autoUploadSourceMaps: !!process.env.PUBLIC_SENTRY_DSN
11+
}), tailwindcss(), sveltekit()],
12+
optimizeDeps: {
13+
exclude: ['esm-env']
14+
}
1115
});

0 commit comments

Comments
 (0)