ente/sentry.server.config.js

29 lines
610 B
JavaScript
Raw Normal View History

2021-06-07 10:45:46 +00:00
import * as Sentry from '@sentry/nextjs';
2022-01-07 11:58:05 +00:00
import {
getSentryDSN,
getSentryENV,
getSentryRelease,
getIsSentryEnabled,
} from 'constants/sentry';
2021-06-07 10:45:46 +00:00
2022-11-17 09:08:22 +00:00
import { getSentryUserID } from 'utils/user';
2022-01-07 11:58:05 +00:00
const SENTRY_DSN = getSentryDSN();
const SENTRY_ENV = getSentryENV();
const SENTRY_RELEASE = getSentryRelease();
const IS_ENABLED = getIsSentryEnabled();
2021-06-07 10:45:46 +00:00
Sentry.init({
dsn: SENTRY_DSN,
enabled: IS_ENABLED,
environment: SENTRY_ENV,
2022-01-07 11:58:05 +00:00
release: SENTRY_RELEASE,
autoSessionTracking: false,
2021-06-07 10:45:46 +00:00
});
2022-11-17 09:08:22 +00:00
2022-11-17 09:14:10 +00:00
const main = async () => {
Sentry.setUser({ id: await getSentryUserID() });
};
main();