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