From ce8f55fd9a9786f6caa72c8899020ed57fac66d2 Mon Sep 17 00:00:00 2001 From: Marijn Doeve Date: Sun, 5 Jul 2026 22:10:50 +0200 Subject: [PATCH] feat: add Spotlight sidecar for local Sentry development testing Add the Spotlight container to compose.override.yaml so the feedback widget and error events can be inspected locally without sending anything to Sentry. The JS SDK switches to spotlight mode automatically when no SENTRY_DSN is configured. --- assets/backoffice.js | 32 ++++++++++++++++---------------- compose.override.yaml | 5 +++++ 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/assets/backoffice.js b/assets/backoffice.js index 6aa04ac..89afbee 100644 --- a/assets/backoffice.js +++ b/assets/backoffice.js @@ -8,21 +8,21 @@ import * as Sentry from '@sentry/browser'; const dsn = document.querySelector('meta[name="sentry-dsn"]')?.content ?? ''; const userEmail = document.querySelector('meta[name="user-email"]')?.content ?? ''; -if (dsn) { - Sentry.init({ - dsn, - integrations: [ - Sentry.feedbackIntegration({ - colorScheme: 'system', - showName: true, - showEmail: true, - isNameRequired: false, - isEmailRequired: false, - }), - ], - }); +Sentry.init({ + dsn: dsn || undefined, + // When no DSN is set (local dev), forward events to Spotlight instead + spotlight: !dsn, + integrations: [ + Sentry.feedbackIntegration({ + colorScheme: 'system', + showName: true, + showEmail: true, + isNameRequired: false, + isEmailRequired: false, + }), + ], +}); - if (userEmail) { - Sentry.setUser({ email: userEmail }); - } +if (userEmail) { + Sentry.setUser({ email: userEmail }); } diff --git a/compose.override.yaml b/compose.override.yaml index 2efd489..7c718e0 100644 --- a/compose.override.yaml +++ b/compose.override.yaml @@ -70,5 +70,10 @@ services: MP_SMTP_AUTH_ALLOW_INSECURE: 1 ###< symfony/mailer ### + spotlight: + image: ghcr.io/getsentry/spotlight:latest + ports: + - "8969:8969" + volumes: sass: