Skip to content

Commit da2af2b

Browse files
authored
docs(js): blacklist/whitelist to deny/allow (#1783)
* docs(js): blacklist/whitelist to deny/allow * Add note regarding versioning
1 parent 1e57c71 commit da2af2b

File tree

1 file changed

+19
-7
lines changed
  • src/collections/_documentation/platforms/javascript

1 file changed

+19
-7
lines changed

src/collections/_documentation/platforms/javascript/index.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -594,17 +594,29 @@ Sentry.init({
594594

595595
The first thing to do is consider constructing a whitelist of domains which might raise acceptable exceptions.
596596

597-
If your scripts are loaded from `cdn.example.com` and your site is `example.com` it’d be reasonable to set `whitelistUrls` to:
597+
If your scripts are loaded from `cdn.example.com` and your site is `example.com` it’d be reasonable to set `allowUrls` to:
598598

599599
```javascript
600600
Sentry.init({
601-
whitelistUrls: [
601+
allowUrls: [
602602
/https?:\/\/((cdn|www)\.)?example\.com/
603603
]
604604
});
605605
```
606606

607-
There is also `blacklistUrls` if you want to block specific URLs forever.
607+
There is also `denyUrls` if you want to block specific URLs forever.
608+
609+
{% capture __alert %}
610+
Prior to version 5.17.0, `allowUrls` and `denyUrls` were called `whitelistUrls` and `blacklistUrls` respectively.
611+
These options are still supported due to backward compatibility reasons, however, they will be removed in version 6.0.
612+
For more information, please see our [Inclusive Language Policy](https://develop.sentry.dev/inclusion/).
613+
{% endcapture %}
614+
615+
{% include components/alert.html
616+
title="Note"
617+
content=__alert
618+
level="warning"
619+
%}
608620

609621
The community has compiled a list of common ignore rules for everyday things, like Facebook, Chrome extensions, etc. So it’s recommended to at least check these out and see if they apply to you. [Here is the original gist](https://gist.github.com/impressiver/5092952). This is not the default value of our SDK; it's just a highlight of an extensive example of what it could be.
610622

@@ -633,7 +645,7 @@ Sentry.init({
633645
// See http://toolbar.conduit.com/Developer/HtmlAndGadget/Methods/JSInjection.aspx
634646
'conduitPage'
635647
],
636-
blacklistUrls: [
648+
denyUrls: [
637649
// Facebook flakiness
638650
/graph\.facebook\.com/i,
639651
// Facebook blocked
@@ -767,10 +779,10 @@ to `integrations` option. For example, to turn off browser capturing console cal
767779

768780
_Import name: `Sentry.Integrations.InboundFilters`_
769781

770-
This integration allows developers to ignore specific errors based on the type or message, as well as blacklist/whitelist URLs that originate from the exception.
771-
It ignores errors, which message starts with `Script error` or `Javascript error: Script error` by default. More on this in our ["What the heck is "Script error"?"](https://blog.sentry.io/2016/05/17/what-is-script-error) blog post. Also, keep in mind that blacklist and whitelist work only for captured exceptions, not raw message events.
782+
This integration allows developers to ignore specific errors based on the type or message, as well as deny/allow URLs that originate from the exception.
783+
It ignores errors, which message starts with `Script error` or `Javascript error: Script error` by default. More on this in our ["What the heck is "Script error"?"](https://blog.sentry.io/2016/05/17/what-is-script-error) blog post. Also, keep in mind that denying and allowing specific events, work only for captured exceptions, not raw message events.
772784

773-
To configure the integration, use `ignoreErrors`, `blacklistUrls`, and `whitelistUrls` SDK options directly. All three options accept an array of strings or RegExp patterns. When provided with a string, they’ll partially match the URL in case of `backlistUrls` and `whitelistUrl`, or two variants in case of `ignoreErrors` - `message` itself, and `${type}: {message}` format. When given RegExp, it will use the `RegExp.test` method instead, which you can use to achieve an exact match if desired.
785+
To configure the integration, use `ignoreErrors`, `denyUrls`, and `allowUrls` SDK options directly. All three options accept an array of strings or RegExp patterns. When provided with a string, they’ll partially match the URL in case of `denyUrls` and `allowUrls`, or two variants in case of `ignoreErrors` - `message` itself, and `${type}: {message}` format. When given RegExp, it will use the `RegExp.test` method instead, which you can use to achieve an exact match if desired.
774786

775787
##### FunctionToString
776788

0 commit comments

Comments
 (0)