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: 3 additions & 0 deletions frontend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@ GOOGLE_LOGIN_DOMAIN="http://localhost:5173"
# Django API URL (PUBLIC_ prefix makes it available in both server and browser)
PUBLIC_DJANGO_API_URL=http://localhost:8000

# Sentry (only set in production — omit locally to disable Sentry)
# PUBLIC_SENTRY_DSN="https://your-dsn.ingest.sentry.io/your-project"

# Environment
NODE_ENV=development
21 changes: 5 additions & 16 deletions frontend/src/hooks.client.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,18 @@
import { handleErrorWithSentry, replayIntegration } from "@sentry/sveltekit";
import * as Sentry from '@sentry/sveltekit';
import { env } from '$env/dynamic/public';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'import' is only available in ES6 (use 'esversion: 6').

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'import' is only available in ES6 (use 'esversion: 6').

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'import' is only available in ES6 (use 'esversion: 6').


Sentry.init({
dsn: 'https://59bf64c93be48f6cd30087fef7bbc54f@o4509449489088512.ingest.de.sentry.io/4510910257496144',
const dsn = env.PUBLIC_SENTRY_DSN || '';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).


Sentry.init({
dsn,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'object short notation' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'object short notation' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'object short notation' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

enabled: !!dsn,
tracesSampleRate: 1.0,

// Enable logs to be sent to Sentry
enableLogs: true,

// This sets the sample rate to be 10%. You may want this to be 100% while
// in development and sample at a lower rate in production
replaysSessionSampleRate: 0.1,

// If the entire session is not sampled, use the below sample rate to sample
// sessions when an error occurs.
replaysOnErrorSampleRate: 1.0,

// If you don't want to use Session Replay, just remove the line below:
integrations: [replayIntegration()],

// Enable sending user PII (Personally Identifiable Information)
// https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#sendDefaultPii
sendDefaultPii: true,
});

// If you have a custom error handler, pass it to `handleErrorWithSentry`
export const handleError = handleErrorWithSentry();
12 changes: 5 additions & 7 deletions frontend/src/instrumentation.server.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import * as Sentry from '@sentry/sveltekit';
import { env } from '$env/dynamic/public';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'import' is only available in ES6 (use 'esversion: 6').

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'import' is only available in ES6 (use 'esversion: 6').

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'import' is only available in ES6 (use 'esversion: 6').


Sentry.init({
dsn: 'https://59bf64c93be48f6cd30087fef7bbc54f@o4509449489088512.ingest.de.sentry.io/4510910257496144',
const dsn = env.PUBLIC_SENTRY_DSN || '';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).


Sentry.init({
dsn,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'object short notation' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'object short notation' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'object short notation' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

enabled: !!dsn,
tracesSampleRate: 1.0,

// Enable logs to be sent to Sentry
enableLogs: true,

// uncomment the line below to enable Spotlight (https://spotlightjs.com)
// spotlight: import.meta.env.DEV,
});
4 changes: 4 additions & 0 deletions frontend/svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import adapter from '@sveltejs/adapter-node';
const config = { kit: {
adapter: adapter(),

version: {
pollInterval: 60000
},

experimental: {
tracing: {
server: true
Expand Down
8 changes: 6 additions & 2 deletions frontend/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import { defineConfig } from 'vite';
export default defineConfig({
plugins: [sentrySvelteKit({
org: "micropyramid-fa",
project: "bottlecrm-app"
}), tailwindcss(), sveltekit()]
project: "bottlecrm-app",
autoUploadSourceMaps: !!process.env.PUBLIC_SENTRY_DSN
}), tailwindcss(), sveltekit()],
optimizeDeps: {
exclude: ['esm-env']
}
});
Loading