Clarification: JavaScript SDK vs React SDK

I wanted a clarification on something. The docs for the React integration mention importing @sentry/browser. I’ve done that and it works.

On the other hand, the docs for the JavaScript integration mention adding a script tag:

<script src="https://browser.sentry-cdn.com/4.2.4/bundle.min.js" crossorigin="anonymous"></script>

Do these both do the same thing? Do I need both? In other words, if I want to track non-React errors as well do I need to follow the steps for the “regular” JS install or is it already taken care of?

Hi, they both do the same thing and @sentry/browser can do everything the CDN (<script>) version can. We should restructure this part of the docs.

Good to know! Speaking of docs, the Sourcemaps part of “Getting Started with Sentry” sent me to this page: https://docs.sentry.io/clients/javascript/sourcemaps

Which has a message saying it’s deprecated. So maybe something you want to look at as well?

1 Like

According to the docs, some features aren’t available when using sentry/browser.

I was using the old raven-js sdk, but after I switched to sentry/browser the whitelistUrls option doesn’t seem to do anything anymore…

This is sadly a documentation bug. We will fix this. It is indeed supported.