ente/sentry.client.config.js

30 lines
904 B
JavaScript
Raw Normal View History

2021-06-07 10:45:46 +00:00
import * as Sentry from '@sentry/nextjs';
2021-06-18 09:29:46 +00:00
import { getSentryTunnelUrl } from 'utils/common/apiUtil';
2021-08-04 07:04:49 +00:00
import { getUserAnonymizedID } from 'utils/user';
2022-01-07 11:58:05 +00:00
import {
getSentryDSN,
getSentryENV,
getSentryRelease,
isSentryEnabled,
} from 'constants/sentry';
2021-07-17 10:21:05 +00:00
2022-01-07 11:58:05 +00:00
const SENTRY_DSN = getSentryDSN();
const SENTRY_ENV = getSentryENV();
const SENTRY_RELEASE = getSentryRelease();
const ENABLED = isSentryEnabled();
2021-07-17 10:21:05 +00:00
2021-08-04 07:04:49 +00:00
Sentry.setUser({ id: getUserAnonymizedID() });
2021-06-07 10:45:46 +00:00
Sentry.init({
dsn: SENTRY_DSN,
2022-01-07 11:58:05 +00:00
enabled: ENABLED,
2021-06-18 09:29:46 +00:00
environment: SENTRY_ENV,
2022-01-07 11:58:05 +00:00
release: SENTRY_RELEASE,
2021-06-09 14:52:11 +00:00
attachStacktrace: true,
2021-08-16 12:49:27 +00:00
autoSessionTracking: false,
2021-06-18 09:29:46 +00:00
tunnel: getSentryTunnelUrl(),
2021-06-07 10:45:46 +00:00
// ...
// Note: if you want to override the automatic release value, do not set a
// `release` value here - use the environment variable `SENTRY_RELEASE`, so
// that it will also get attached to your source maps
});