Skip to content

loader script: configure replay options #8704

Answered by AbhiPrasad
mustafa0x asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @mustafa0x

My question is how to configure the replay options

You can call Sentry.init again in Sentry.onLoad and configure the replay integration there.

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 maskAllInputs to false though as you could be sending PII or other sensitive information to Sentry.

Related: it's also difficult to send the release slug when using the loader. Perhaps if a global variable …

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@mustafa0x
Comment options

@AbhiPrasad
Comment options

@karlbot
Comment options

@lforst
Comment options

@karlbot
Comment options

Answer selected by lforst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants