The Node.js® Website
at main 1.4 kB view raw
1import { BASE_URL, IS_DEVELOPMENT, VERCEL_ENV } from './next.constants.mjs'; 2 3/** 4 * This is the Sentry DSN for the Node.js Website Project 5 */ 6export const SENTRY_DSN = 7 'https://02884d0745aecaadf5f780278fe5fe70@o4506191161786368.ingest.sentry.io/4506191307735040'; 8 9/** 10 * This states if Sentry should be enabled and bundled within our App 11 * 12 * We enable sentry by default if we're om development mode or deployed 13 * on Vercel (either production or preview branches) 14 */ 15export const SENTRY_ENABLE = IS_DEVELOPMENT || !!VERCEL_ENV; 16 17/** 18 * This configures the sampling rate for Sentry 19 * 20 * We always want to capture 100% on Vercel Preview Branches 21 * and not when it's on Production Mode (nodejs.org) 22 */ 23export const SENTRY_CAPTURE_RATE = 24 SENTRY_ENABLE && VERCEL_ENV && BASE_URL !== 'https://nodejs.org' ? 1.0 : 0.01; 25 26/** 27 * Provides the Route for Sentry's Server-Side Tunnel 28 * 29 * This is a `@sentry/nextjs` specific feature 30 */ 31export const SENTRY_TUNNEL = (components = '') => 32 SENTRY_ENABLE ? `/monitoring${components}` : undefined; 33 34/** 35 * This configures which Sentry features to tree-shake/remove from the Sentry bundle 36 * 37 * @see https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/tree-shaking/ 38 */ 39export const SENTRY_EXTENSIONS = { 40 __SENTRY_DEBUG__: false, 41 __SENTRY_TRACING__: false, 42 __RRWEB_EXCLUDE_IFRAME__: true, 43 __RRWEB_EXCLUDE_SHADOW_DOM__: true, 44 __SENTRY_EXCLUDE_REPLAY_WORKER__: true, 45};