diff --git a/sentry.client.config.js b/sentry.client.config.js index 3eec2c8fc..aeda578d9 100644 --- a/sentry.client.config.js +++ b/sentry.client.config.js @@ -13,7 +13,6 @@ const SENTRY_ENV = getSentryENV(); const SENTRY_RELEASE = getSentryRelease(); const IS_ENABLED = getIsSentryEnabled(); -Sentry.setUser({ id: getSentryUserID() }); Sentry.init({ dsn: SENTRY_DSN, enabled: IS_ENABLED, @@ -39,3 +38,9 @@ Sentry.init({ // `release` value here - use the environment variable `SENTRY_RELEASE`, so // that it will also get attached to your source maps }); + +const main = async () => { + Sentry.setUser({ id: await getSentryUserID() }); +}; + +main(); diff --git a/sentry.server.config.js b/sentry.server.config.js index 5d8714c99..79b62e6bd 100644 --- a/sentry.server.config.js +++ b/sentry.server.config.js @@ -6,6 +6,8 @@ import { getIsSentryEnabled, } from 'constants/sentry'; +import { getSentryUserID } from 'utils/user'; + const SENTRY_DSN = getSentryDSN(); const SENTRY_ENV = getSentryENV(); const SENTRY_RELEASE = getSentryRelease(); @@ -18,3 +20,9 @@ Sentry.init({ release: SENTRY_RELEASE, autoSessionTracking: false, }); + +const main = async () => { + Sentry.setUser({ id: await getSentryUserID() }); +}; + +main();