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.
22 lines
749 B
TypeScript
22 lines
749 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 server.
|
||
|
// The config you add here will be used whenever the server handles a request.
|
||
|
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
|
||
|
|
||
|
import * as Sentry from '@sentry/nextjs'
|
||
|
|
||
|
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: [],
|
||
|
tracesSampleRate: 0.2,
|
||
|
environment: Environment,
|
||
|
release: process.env.NEXT_PUBLIC_COMMITHASH,
|
||
|
enabled: !!Environment && Environment !== 'debug',
|
||
|
autoSessionTracking: false,
|
||
|
})
|