@@ -289,43 +289,45 @@ If you are using the `Hub` right now, see the following table on how to migrate
289
289
| endSession() | ` Sentry.endSession() ` |
290
290
| shouldSendDefaultPii() | REMOVED - The closest equivalent is ` Sentry.getClient().getOptions().sendDefaultPii ` |
291
291
292
- The ` Hub ` constructor is also deprecated and will be removed in the next major version. If you are creating
293
- Hubs for multi-client use like so:
292
+ The ` Hub ` constructor is also deprecated and will be removed in the next major version. If you are creating Hubs for
293
+ multi-client use like so:
294
294
295
- ``` js
295
+ ``` ts
296
296
// OLD
297
297
const hub = new Hub ();
298
298
hub .bindClient (client );
299
- makeMain (hub)
299
+ makeMain (hub );
300
300
```
301
301
302
302
instead initialize the client as follows:
303
303
304
- ``` js
304
+ ``` ts
305
305
// NEW
306
306
Sentry .withIsolationScope (() => {
307
- Sentry .setCurrentClient (client);
308
- client .init ();
307
+ Sentry .setCurrentClient (client );
308
+ client .init ();
309
309
});
310
310
```
311
311
312
312
If you are using the Hub to capture events like so:
313
313
314
- ``` js
314
+ ``` ts
315
315
// OLD
316
316
const client = new Client ();
317
317
const hub = new Hub (client );
318
- hub .captureException ()
318
+ hub .captureException ();
319
319
```
320
320
321
321
instead capture isolated events as follows:
322
322
323
- ``` js
323
+ ``` ts
324
324
// NEW
325
325
const client = new Client ();
326
326
const scope = new Scope ();
327
327
scope .setClient (client );
328
328
scope .captureException ();
329
+ ```
330
+
329
331
## Deprecate ` client.setupIntegrations() `
330
332
331
333
Instead, use the new ` client.init() ` method. You should probably not use this directly and instead use ` Sentry.init() ` ,
@@ -392,7 +394,7 @@ app.get('/your-route', req => {
392
394
);
393
395
});
394
396
});
395
- ` ` ` `
397
+ ```
396
398
397
399
## Deprecate ` Sentry.lastEventId() ` and ` hub.lastEventId() `
398
400
0 commit comments