forked from thejasonxie/private-github-link
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstrument.server.mjs
More file actions
20 lines (18 loc) · 782 Bytes
/
instrument.server.mjs
File metadata and controls
20 lines (18 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import * as Sentry from '@sentry/tanstackstart-react'
// Sentry DSN from environment variables
// - Local dev: loaded from .env.local via dotenv
// - Deployed: injected by SST from secrets
const sentryDsn = process.env.SENTRY_DSN ?? process.env.VITE_SENTRY_DSN
if (!sentryDsn) {
console.warn('[Sentry] No DSN configured. Sentry is not running.')
} else {
Sentry.init({
dsn: sentryDsn,
environment: process.env.NODE_ENV || 'development',
// Adds request headers and IP for users, for more info visit:
// https://docs.sentry.io/platforms/javascript/guides/tanstackstart-react/configuration/options/#sendDefaultPii
sendDefaultPii: true,
// Adjust sample rates for production
tracesSampleRate: process.env.NODE_ENV === 'production' ? 0.1 : 1.0,
})
}