File tree Expand file tree Collapse file tree 4 files changed +16
-9
lines changed Expand file tree Collapse file tree 4 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -7,13 +7,15 @@ interface Environment {
77 NODE_ENV : string
88 LOG : boolean
99 API_URL : string
10+ SENTRY_DSN : string | null
1011}
1112
1213const environment : Environment = {
1314 VERSION : process . env . VERSION || 'unknown' ,
1415 NODE_ENV : process . env . NODE_ENV || 'production' ,
1516 LOG : ( process . env . LOG || '' ) . toLowerCase ( ) === 'true' ,
1617 API_URL : process . env . REACT_APP_GQL_URI || '' ,
18+ SENTRY_DSN : process . env . SENTRY_DSN || null ,
1719}
1820
1921export default environment
Original file line number Diff line number Diff line change 11import { init } from '@sentry/node'
22import environment from '../../environment'
33
4- init ( {
5- dsn : 'https://df4a6ae19e8b44ed9a87ae4432dab9df@sentry.io/1889368' ,
6- environment : environment . NODE_ENV ,
7- } )
4+ if ( environment . SENTRY_DSN ) {
5+ init ( {
6+ dsn : environment . SENTRY_DSN ,
7+ environment : environment . NODE_ENV ,
8+ } )
9+ }
Original file line number Diff line number Diff line change @@ -11,3 +11,4 @@ export const VERSION: string = process.env.VERSION || 'unknown'
1111export const NODE_ENV : string = process . env . NODE_ENV || 'development'
1212export const LOG_STATE : boolean = ( process . env . REACT_APP_LOG_STATE || '' ) . toLowerCase ( ) === 'true'
1313export const TUTORIAL_LIST_URL : string = process . env . REACT_APP_TUTORIAL_LIST_URL || ''
14+ export const SENTRY_DSN : string | null = process . env . REACT_APP_SENTRY_DSN || null
Original file line number Diff line number Diff line change 11import * as sentry from '@sentry/browser'
2- import { NODE_ENV } from '../../environment'
2+ import { NODE_ENV , SENTRY_DSN } from '../../environment'
33
44try {
5- sentry . init ( {
6- dsn : 'https://701cee76c32a4408b2fcb6af3e139d46@sentry.io/1889371' ,
7- environment : NODE_ENV ,
8- } )
5+ if ( SENTRY_DSN ) {
6+ sentry . init ( {
7+ dsn : SENTRY_DSN ,
8+ environment : NODE_ENV ,
9+ } )
10+ }
911} catch ( error ) {
1012 console . log ( 'Error in Sentry init' )
1113 console . log ( error )
You can’t perform that action at this time.
0 commit comments