You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
944 B
TypeScript
28 lines
944 B
TypeScript
2 years ago
|
/* eslint-disable unicorn/prefer-module */
|
||
|
/* eslint-disable @typescript-eslint/no-var-requires */
|
||
|
|
||
|
// This file configures the initialization of Sentry on the browser.
|
||
|
// The config you add here will be used whenever a page is visited.
|
||
|
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
|
||
|
|
||
|
import * as Sentry from '@sentry/nextjs'
|
||
|
import { Integrations } from '@sentry/tracing'
|
||
|
|
||
|
const Environment = process.env.NOVELAI_ENVIRONMENT ?? 'debug'
|
||
|
const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN
|
||
|
|
||
|
Sentry.init({
|
||
|
dsn: SENTRY_DSN,
|
||
|
integrations: [
|
||
|
new Integrations.BrowserTracing({
|
||
|
startTransactionOnPageLoad: true,
|
||
|
startTransactionOnLocationChange: false,
|
||
|
}),
|
||
|
],
|
||
|
tracesSampleRate: 0.2,
|
||
|
environment: Environment,
|
||
|
release: process.env.NEXT_PUBLIC_COMMITHASH,
|
||
|
enabled: !!Environment && Environment !== 'debug',
|
||
|
autoSessionTracking: false,
|
||
|
})
|