You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Additional migration notes from raven-js (getsentry#2629)
A few important keys were renamed (such as `shouldSendCallback`) without
any notice in the docs.
Additionally, this commit adds links to the appropriate documentation pages
so the user can learn more about how to use new features, such as `withScope`.
> 'ignoreUrls' was renamed to 'blacklistUrls'. 'ignoreErrors', which has a similar name was not renamed. [Docs](https://docs.sentry.io/error-reporting/configuration/?platform=browser#blacklist-urls) and [Decluttering Sentry](https://docs.sentry.io/platforms/javascript/#decluttering-sentry)
257
+
258
+
_Old_:
259
+
260
+
```js
261
+
Sentry.init({
262
+
ignoreUrls: [
263
+
'https://www.baddomain.com',
264
+
/graph\.facebook\.com/i,
265
+
],
266
+
});
267
+
```
268
+
269
+
_New_:
270
+
271
+
```js
272
+
Sentry.init({
273
+
blacklistUrls: [
274
+
'https://www.baddomain.com',
275
+
/graph\.facebook\.com/i,
276
+
],
277
+
});
278
+
```
279
+
280
+
### Ignoring Events (`shouldSendCallback`)
281
+
282
+
> `shouldSendCallback` was renamed to `beforeSend` ([#2253](https://github.com/getsentry/sentry-javascript/issues/2253)). Instead of returning `false`, you must return `null` to omit sending the event. [Docs](https://docs.sentry.io/error-reporting/configuration/filtering/?platform=browser#before-send)
283
+
284
+
_Old_:
285
+
286
+
```js
287
+
Sentry.init({
288
+
shouldSendCallback(event) {
289
+
// Modify the event here
290
+
if(event.user){
291
+
// Don't send user's email address
292
+
deleteevent.user.email;
293
+
} else {
294
+
returnfalse; // don't send this event
295
+
}
296
+
returnevent;
297
+
}
298
+
});
299
+
```
300
+
301
+
_New_:
302
+
303
+
```js
304
+
Sentry.init({
305
+
beforeSend(event) {
306
+
// Modify the event here
307
+
if(event.user){
308
+
// Don't send user's email address
309
+
deleteevent.user.email;
310
+
} else {
311
+
returnnull; // don't send this event
312
+
}
313
+
returnevent;
314
+
}
315
+
});
316
+
```
317
+
318
+
### Attaching Stacktraces
319
+
320
+
> 'stacktrace' was renamed to 'attackStacktrace'. [Docs](https://docs.sentry.io/error-reporting/configuration/?platform=browser#attach-stacktrace)
0 commit comments