|
@@ -1,18 +1,24 @@
|
|
|
import * as Sentry from '@sentry/nextjs';
|
|
|
import { getSentryTunnelUrl } from 'utils/common/apiUtil';
|
|
|
import { getUserAnonymizedID } from 'utils/user';
|
|
|
+import {
|
|
|
+ getSentryDSN,
|
|
|
+ getSentryENV,
|
|
|
+ getSentryRelease,
|
|
|
+ isSentryEnabled,
|
|
|
+} from './configUtil';
|
|
|
|
|
|
-const SENTRY_DSN =
|
|
|
- process.env.NEXT_PUBLIC_SENTRY_DSN ??
|
|
|
- 'https://860186db60c54c7fbacfe255124958e8@errors.ente.io/4';
|
|
|
-const SENTRY_ENV = process.env.NEXT_PUBLIC_SENTRY_ENV ?? 'development';
|
|
|
+const SENTRY_DSN = getSentryDSN();
|
|
|
+const SENTRY_ENV = getSentryENV();
|
|
|
+const SENTRY_RELEASE = getSentryRelease();
|
|
|
+const ENABLED = isSentryEnabled();
|
|
|
|
|
|
Sentry.setUser({ id: getUserAnonymizedID() });
|
|
|
Sentry.init({
|
|
|
dsn: SENTRY_DSN,
|
|
|
- enabled: SENTRY_ENV !== 'development',
|
|
|
+ enabled: ENABLED,
|
|
|
environment: SENTRY_ENV,
|
|
|
- release: process.env.SENTRY_RELEASE,
|
|
|
+ release: SENTRY_RELEASE,
|
|
|
attachStacktrace: true,
|
|
|
autoSessionTracking: false,
|
|
|
tunnel: getSentryTunnelUrl(),
|