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 {
3939 applyTunnelRouteOption ( options ) ;
4040 buildMetadata ( options , [ 'nextjs' , 'react' ] ) ;
4141
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 ;
4346
4447 addClientIntegrations ( options ) ;
4548
Original file line number Diff line number Diff line change @@ -47,7 +47,10 @@ export function init(options: EdgeOptions = {}): void {
4747 }
4848
4949 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 ;
5154
5255 if ( options . autoSessionTracking === undefined && options . dsn !== undefined ) {
5356 options . autoSessionTracking = true ;
Original file line number Diff line number Diff line change @@ -81,7 +81,10 @@ export function init(options: NodeOptions): void {
8181 buildMetadata ( options , [ 'nextjs' , 'node' ] ) ;
8282
8383 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 ;
8588
8689 addServerIntegrations ( options ) ;
8790 // Right now we only capture frontend sessions for Next.js
You can’t perform that action at this time.
0 commit comments