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
8 changes: 5 additions & 3 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
import { callToActionValidator } from './src/integrations/CtaValidator'
import { faviconGenerator } from './src/integrations/FaviconGenerator'
import { privacyPolicyVersion } from './src/integrations/PrivacyPolicyVersion'
import { getPackageRelease, packageRelease } from './src/integrations/PackageRelease'
import { packageRelease } from './src/integrations/PackageRelease'
import { testimonialsLengthWarning } from './src/integrations/TestimonialsLengthWarning'
import { fixContentAssetPropagation } from './src/lib/plugins/fixContentAssetPropagation'
import { pwaDevAssetServer } from './src/lib/plugins/pwaDevAssetServer'
Expand All @@ -40,7 +40,6 @@ import { createSerializeFunction, pagesJsonWriter } from './src/integrations/sit
const devServerPort = Number(process.env['DEV_SERVER_PORT'] ?? 4321)
const viteLogger = createLogger(undefined, { allowClearScreen: false })
const sentryAuthToken = process.env['SENTRY_AUTH_TOKEN']
const sentryRelease = getPackageRelease()
const shouldEnableSentryIntegration = Boolean(sentryAuthToken)

const shouldSuppressViteWarning = (message: string): boolean => {
Expand Down Expand Up @@ -85,10 +84,13 @@ const standardIntegrations = [
testimonialsLengthWarning({ min: 300, max: 400 }),
/** Enable Sentry build integration when CI provides upload credentials. */
...(shouldEnableSentryIntegration && sentryAuthToken ? [sentry({
enabled: {
client: false,
server: true,
},
project: 'webstack-builders-corporate-website',
org: 'webstack-builders',
authToken: sentryAuthToken,
release: sentryRelease,
})] : []),
sitemap({
serialize: createSerializeFunction({
Expand Down
8 changes: 2 additions & 6 deletions src/components/scripts/sentry/client.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import {
BrowserClient,
breadcrumbsIntegration,
dedupeIntegration,
defaultStackParser,
feedbackIntegration,
getCurrentScope,
globalHandlersIntegration,
httpClientIntegration,
init,
makeFetchTransport,
linkedErrorsIntegration,
} from '@sentry/browser'
Expand Down Expand Up @@ -34,7 +33,7 @@ export class SentryBootstrap {
static init(): void {
// Check analytics consent for PII handling
const hasAnalyticsConsent = getAnalyticsConsentPreference()
const client = new BrowserClient({
init({
dsn: getSentryDsn(),
integrations: [
// Core integrations
Expand Down Expand Up @@ -103,9 +102,6 @@ export class SentryBootstrap {
beforeSend: beforeSendHandler,
})

getCurrentScope().setClient(client)
client.init()

console.log('βœ… Sentry monitoring initialized')
}
}
Loading