ente/sentry.client.config.js

23 lines
873 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-07-17 10:21:05 +00:00
import { getData, LS_KEYS } from 'utils/storage/localStorage';
2021-06-07 10:45:46 +00:00
2021-06-16 07:40:42 +00:00
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';
2021-07-17 10:21:05 +00:00
const userID = getData(LS_KEYS.USER)?.id;
Sentry.setUser({ id: userID });
2021-06-07 10:45:46 +00:00
Sentry.init({
dsn: SENTRY_DSN,
enabled: SENTRY_ENV !== 'development',
2021-06-18 09:29:46 +00:00
environment: SENTRY_ENV,
release: process.env.SENTRY_RELEASE,
2021-06-09 14:52:11 +00:00
attachStacktrace: true,
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
});