File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,9 @@ const globalWithInjectedValues = global as typeof global & {
38
38
export function init ( options : BrowserOptions ) : void {
39
39
applyTunnelRouteOption ( options ) ;
40
40
buildMetadata ( options , [ 'nextjs' , 'react' ] ) ;
41
- options . environment = options . environment || process . env . NODE_ENV ;
41
+
42
+ options . environment = options . environment || process . env . NEXT_PUBLIC_VERCEL_ENV || process . env . NODE_ENV ;
43
+
42
44
addClientIntegrations ( options ) ;
43
45
44
46
reactInit ( options ) ;
Original file line number Diff line number Diff line change @@ -46,9 +46,8 @@ export function init(options: EdgeOptions = {}): void {
46
46
}
47
47
}
48
48
49
- if ( options . environment === undefined && process . env . SENTRY_ENVIRONMENT ) {
50
- options . environment = process . env . SENTRY_ENVIRONMENT ;
51
- }
49
+ options . environment =
50
+ options . environment || process . env . SENTRY_ENVIRONMENT || process . env . VERCEL_ENV || process . env . NODE_ENV ;
52
51
53
52
if ( options . autoSessionTracking === undefined && options . dsn !== undefined ) {
54
53
options . autoSessionTracking = true ;
Original file line number Diff line number Diff line change @@ -79,7 +79,10 @@ export function init(options: NodeOptions): void {
79
79
}
80
80
81
81
buildMetadata ( options , [ 'nextjs' , 'node' ] ) ;
82
- options . environment = options . environment || process . env . NODE_ENV ;
82
+
83
+ options . environment =
84
+ options . environment || process . env . SENTRY_ENVIRONMENT || process . env . VERCEL_ENV || process . env . NODE_ENV ;
85
+
83
86
addServerIntegrations ( options ) ;
84
87
// Right now we only capture frontend sessions for Next.js
85
88
options . autoSessionTracking = false ;
You can’t perform that action at this time.
0 commit comments