loader script: configure replay options #8704
-
|
I'm using the js-sdk-loader, which loads bundle.tracing.replay.min.js. My question is how to configure the replay options? I tried this, but it didn't always work (due to minification, and onLoad, when loading the page the second time, was firing before all integrations were loaded). Sentry.onLoad(() => {
const {client} = Sentry.getCurrentHub().getStack()[0]
Object.assign(client._integrations.Replay._recordingOptions, {maskAllInputs: false, maskAllText: false})
})I settled on Related: it's also difficult to send the release slug when using the loader. Perhaps if a global variable can be set, that the loader reads from if present (similar to |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
|
Hey @mustafa0x
You can call Sentry.onLoad(() => {
Sentry.init({
tracesSampleRate: 1.0,
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
integrations: [
new Sentry.Replay({
maskAllInputs: false,
maskAllText: false,
}),
new Sentry.BrowserTracing(),
],
});
});I heavily recommend setting
You can set the sentry-javascript/packages/browser/src/sdk.ts Lines 109 to 112 in 85effab Docs: https://docs.sentry.io/platforms/javascript/install/loader/#sdk-configuration |
Beta Was this translation helpful? Give feedback.
Hey @mustafa0x
You can call
Sentry.initagain inSentry.onLoadand configure the replay integration there.I heavily recommend setting
maskAllInputsto false though as you could be sending PII or other sensitive information to Sentry.