Bundled Sentry Browser with enabled those integrations:
- BrowserTracing
- ExtraErrorData
- CaptureConsole
- HttpClient
Version of this package will match versions of its main dependencies:
-
@sentry/browser
:- BrowserTracing
-
@sentry/integrations
:- ExtraErrorData
- CaptureConsole
- ContextLines
- HttpClient
In order to configure it, you need to pass the options object with those properties:
dsn
env
release
-
userId
*
Add userId
only if Sentry is not collecting it properly.
- Install the package
npm i @carisls/sentry-browser
2 Export bundled file as a static resource (Express)
app.use('/third-party/sentry-browser', express.static(path.join(__dirname, 'node_modules/@carisls/sentry-browser/dist')));
3 Reference it in HTML/PUG file
<script type="module">
import configureSentry from '/third-party/sentry-browser/bundle.min.js'
configureSentry({
dsn: '...',
env: 'development',
release: 'v10.0.4',
userId: 'peterp@gmail.com'
}),
</script>
If you want to use bundlers, you can use @sentry/browser
and @sentry/integrations
modules directly.