@@ -20,7 +20,7 @@ stable release of `8.x` comes out).
20
20
21
21
## 1. Version Support changes:
22
22
23
- ** Node.js** : We now official support Node 14+ for our CJS package, and Node 18.8+ for our ESM package. This applies to
23
+ ** Node.js** : We now official support Node 14.8 + for our CJS package, and Node 18.8+ for our ESM package. This applies to
24
24
` @sentry/node ` and all of our node-based server-side sdks (` @sentry/nextjs ` , ` @sentry/serverless ` , etc.). We no longer
25
25
test against Node 8, 10, or 12 and cannot guarantee that the SDK will work as expected on these versions.
26
26
@@ -62,7 +62,7 @@ We've removed the following packages:
62
62
For Browser SDKs you can import ` BrowserTracing ` from the SDK directly:
63
63
64
64
``` js
65
- // Before
65
+ // Before (v7)
66
66
import * as Sentry from ' @sentry/browser' ;
67
67
import { BrowserTracing } from ' @sentry/tracing' ;
68
68
@@ -72,7 +72,7 @@ Sentry.init({
72
72
integrations: [new BrowserTracing ()],
73
73
});
74
74
75
- // After
75
+ // After (v8)
76
76
import * as Sentry from ' @sentry/browser' ;
77
77
78
78
Sentry .init ({
@@ -86,7 +86,7 @@ If you were importing `@sentry/tracing` for the side effect, you can now use `Se
86
86
tracing extensions to the SDK. ` addTracingExtensions ` replaces the ` addExtensionMethods ` method from ` @sentry/tracing ` .
87
87
88
88
``` js
89
- // Before
89
+ // Before (v7)
90
90
import * as Sentry from ' @sentry/browser' ;
91
91
import ' @sentry/tracing' ;
92
92
@@ -95,22 +95,21 @@ Sentry.init({
95
95
tracesSampleRate: 1.0 ,
96
96
});
97
97
98
- // After
98
+ // After (v8)
99
99
import * as Sentry from ' @sentry/browser' ;
100
100
101
101
Sentry .addTracingExtensions ();
102
102
103
103
Sentry .init ({
104
104
dsn: ' __DSN__' ,
105
105
tracesSampleRate: 1.0 ,
106
- integrations: [new Sentry.BrowserTracing ()],
107
106
});
108
107
```
109
108
110
109
For Node SDKs you no longer need the side effect import, you can remove all references to ` @sentry/tracing ` .
111
110
112
111
``` js
113
- // Before
112
+ // Before (v7)
114
113
const Sentry = require (' @sentry/node' );
115
114
require (' @sentry/tracing' );
116
115
@@ -119,7 +118,7 @@ Sentry.init({
119
118
tracesSampleRate: 1.0 ,
120
119
});
121
120
122
- // After
121
+ // Before (v8)
123
122
const Sentry = require (' @sentry/node' );
124
123
125
124
Sentry .init ({
@@ -135,28 +134,28 @@ package (`@sentry/integrations`) to `@sentry/browser` and `@sentry/node`. in add
135
134
classes.
136
135
137
136
``` js
138
- // before
137
+ // Before (v7)
139
138
import { RewriteFrames } from ' @sentry/integrations' ;
140
139
141
- // after
140
+ // After (v8)
142
141
import { rewriteFramesIntegration } from ' @sentry/browser' ;
143
142
```
144
143
145
144
Integrations that are now exported from ` @sentry/browser ` (or framework-specific packages like ` @sentry/react ` ):
146
145
147
- - httpClientIntegration (` HTTPClient ` )
148
- - contextLinesIntegration (` ContextLines ` )
149
- - reportingObserverIntegration (` ReportingObserver ` )
146
+ - ` httpClientIntegration ` (` HTTPClient ` )
147
+ - ` contextLinesIntegration ` (` ContextLines ` )
148
+ - ` reportingObserverIntegration ` (` ReportingObserver ` )
150
149
151
150
Integrations that are now exported from ` @sentry/node ` and ` @sentry/browser ` (or framework-specific packages like
152
151
` @sentry/react ` ):
153
152
154
- - captureConsoleIntegration (` CaptureConsole ` )
155
- - debugIntegration (` Debug ` )
156
- - extraErrorDataIntegration (` ExtraErrorData ` )
157
- - rewriteFramesIntegration (` RewriteFrames ` )
158
- - sessionTimingIntegration (` SessionTiming ` )
159
- - dedupeIntegration (` Dedupe ` ) - _ Note: enabled by default, not pluggable_
153
+ - ` captureConsoleIntegration ` (` CaptureConsole ` )
154
+ - ` debugIntegration ` (` Debug ` )
155
+ - ` extraErrorDataIntegration ` (` ExtraErrorData ` )
156
+ - ` rewriteFramesIntegration ` (` RewriteFrames ` )
157
+ - ` sessionTimingIntegration ` (` SessionTiming ` )
158
+ - ` dedupeIntegration ` (` Dedupe ` ) - _ Note: enabled by default, not pluggable_
160
159
161
160
The ` Transaction ` integration has been removed from ` @sentry/integrations ` . There is no replacement API.
162
161
@@ -302,10 +301,10 @@ The `getIntegration()` and `getIntegrationById()` have been removed entirely, se
302
301
[ below] ( ./MIGRATION.md#deprecate-getintegration-and-getintegrationbyid ) .
303
302
304
303
``` js
305
- // before
304
+ // Before (v7)
306
305
const replay = Sentry .getIntegration (Replay);
307
306
308
- // after
307
+ // After (v8)
309
308
const replay = getClient ().getIntegrationByName (' Replay' );
310
309
```
311
310
@@ -317,16 +316,19 @@ the behavior of the `tracePropagationTargets` option for Browser SDKs, see
317
316
[ below] ( ./MIGRATION.md/#updated-behaviour-of-tracepropagationtargets-in-the-browser-http-tracing-headers--cors ) for more
318
317
details.
319
318
319
+ For example for the Browser SDKs:
320
+
320
321
``` ts
321
- // Before (Browser )
322
+ // Before (v7 )
322
323
Sentry .init ({
323
324
dsn: ' __DSN__' ,
324
- integrations: [new Sentry .BrowserTracing ({})],
325
+ integrations: [new Sentry .BrowserTracing ({ tracingOrigins: [ ' localhost ' , ' example.com ' ] })],
325
326
});
326
327
327
- // After
328
+ // After (v8)
328
329
Sentry .init ({
329
330
dsn: ' __DSN__' ,
331
+ integrations: [Sentry .browserTracingIntegration ()],
330
332
tracePropagationTargets: [' localhost' , ' example.com' ],
331
333
});
332
334
```
@@ -336,7 +338,7 @@ Sentry.init({
336
338
The SDKs now support metrics features without any additional configuration.
337
339
338
340
``` ts
339
- // before
341
+ // Before (v7)
340
342
// Server (Node/Deno/Bun)
341
343
Sentry .init ({
342
344
dsn: ' __DSN__' ,
@@ -345,13 +347,14 @@ Sentry.init({
345
347
},
346
348
});
347
349
350
+ // Before (v7)
348
351
// Browser
349
352
Sentry .init ({
350
353
dsn: ' __DSN__' ,
351
354
integrations: [Sentry .metricsAggregatorIntegration ()],
352
355
});
353
356
354
- // after
357
+ // After (v8)
355
358
Sentry .init ({
356
359
dsn: ' __DSN__' ,
357
360
});
@@ -363,14 +366,14 @@ In v7 we deprecated the `Severity` enum in favor of using the `SeverityLevel` ty
363
366
this has been removed in v8. You should now use the ` SeverityLevel ` type directly.
364
367
365
368
``` js
366
- // Before:
369
+ // Before (v7)
367
370
import { Severity , SeverityLevel } from ' @sentry/types' ;
368
371
369
372
const levelA = Severity .error ;
370
373
371
374
const levelB: SeverityLevel = " error"
372
375
373
- // After
376
+ // After (v8)
374
377
import { SeverityLevel } from ' @sentry/types' ;
375
378
376
379
const levelA = " error" as SeverityLevel;
@@ -384,12 +387,12 @@ The top level `Sentry.configureScope` function has been removed. Instead, you sh
384
387
to access and mutate the current scope.
385
388
386
389
``` js
387
- // Before
390
+ // Before (v7)
388
391
Sentry .configureScope (scope => {
389
392
scope .setTag (' key' , ' value' );
390
393
});
391
394
392
- // After
395
+ // After (v8)
393
396
Sentry .getCurrentScope ().setTag (' key' , ' value' );
394
397
```
395
398
@@ -403,10 +406,10 @@ Internally, this class is now called `SentrySpan`, and it is no longer meant to
403
406
In v8, we are removing the ` spanStatusfromHttpCode ` function in favor of ` getSpanStatusFromHttpCode ` .
404
407
405
408
``` js
406
- // before
409
+ // Before (v7)
407
410
const spanStatus = spanStatusfromHttpCode (200 );
408
411
409
- // after
412
+ // After (v8)
410
413
const spanStatus = getSpanStatusFromHttpCode (200 );
411
414
```
412
415
@@ -415,13 +418,13 @@ const spanStatus = getSpanStatusFromHttpCode(200);
415
418
In v8, we are removing the ` addGlobalEventProcessor ` function in favor of ` addEventProcessor ` .
416
419
417
420
``` js
418
- // before
421
+ // Before (v7)
419
422
addGlobalEventProcessor (event => {
420
423
delete event .extra ;
421
424
return event ;
422
425
});
423
426
424
- // after
427
+ // After (v8)
425
428
addEventProcessor (event => {
426
429
delete event .extra ;
427
430
return event ;
@@ -661,7 +664,7 @@ Sentry.init({
661
664
integrations: [Sentry .browserTracingIntegration ()],
662
665
});
663
666
664
- // You still need to add the Trace Service like before!
667
+ // You still need to add the TraceService like before!
665
668
```
666
669
667
670
### ` @sentry/remix `
@@ -963,7 +966,6 @@ callback.
963
966
964
967
``` js
965
968
// Before
966
-
967
969
Sentry .init ({
968
970
beforeSend (event , hint ) {
969
971
const lastCapturedEventId = Sentry .lastEventId ();
0 commit comments