Currently, replay is configured like this:
newReplay({// replay specific configuseCompression: true,stickySession: true,// this is passed directly to rrwebblockClass: 'sentry-block',ignoreClass: 'sentry-ignore',maskTextClass: 'sentry-mask'});From a code perspective, this happens with a rest operator:
constructor({
flushMinDelay =5000,
flushMaxDelay =15000,
initialFlushDelay =5000,
stickySession =true,
useCompression =true,
sessionSampleRate =DEFAULT_SESSION_SAMPLE_RATE,
errorSampleRate =DEFAULT_ERROR_SAMPLE_RATE,
maskAllText =true,
maskAllInputs =true,
blockAllMedia =true,
blockClass ='sentry-block',
ignoreClass ='sentry-ignore',
maskTextClass ='sentry-mask',
blockSelector ='[data-sentry-block]',
...recordingOptions,// <-- this is the important part}: ReplayConfiguration={}){This basically means that any config passed to new Replay() that is not defined above will be passed to rrweb.
In order to streamline this and make this more explicit, I propose to change this API to:
newReplay({// replay specific configuseCompression: true,stickySession: true,recordingOptions: {blockClass: 'sentry-block',ignoreClass: 'sentry-ignore',maskTextClass: 'sentry-mask'}});This would make it much more explicit which options are only related to rrweb.
We can still promote all options we care about/think are important to the top level and internall pass them to recordingOptions, e.g.:
newReplay({// replay specific configuseCompression: true,stickySession: true,// Explicit rrweb options we care about - name can match, but could also be differentblockClass: 'myClass',otherNameForIgnoreClass: 'ignore'recordingOptions: {}});For now, I propose to add these options to the top level:
ignoreClass: string | string[] one or multiple classes to ignore. We can internally convert this for ignoreClassblockClass: string | string[]: one or multiple classes to blockblockSelector: string | string[]: One or multiple selectors to blockmaskTextClass: string | string[]: one or multiple classes to mask text forinlineImages: If true, inline images as data URIsrecordCanvas: If true, record canvas element content
Which covers the most relevant stuff, and also the stuff we currently provide default values for.
For the initial release, we can still handle the "old" way of config, warn when we detect "unknown" config, and still make it work. And then remove this deprecated functionality in the near future.
Currently, replay is configured like this:
From a code perspective, this happens with a rest operator:
This basically means that any config passed to
new Replay()that is not defined above will be passed to rrweb.In order to streamline this and make this more explicit, I propose to change this API to:
This would make it much more explicit which options are only related to rrweb.
We can still promote all options we care about/think are important to the top level and internall pass them to
recordingOptions, e.g.:For now, I propose to add these options to the top level:
ignoreClass: string | string[]one or multiple classes to ignore. We can internally convert this forignoreClassblockClass: string | string[]: one or multiple classes to blockblockSelector: string | string[]: One or multiple selectors to blockmaskTextClass: string | string[]: one or multiple classes to mask text forinlineImages: If true, inline images as data URIsrecordCanvas: If true, record canvas element contentWhich covers the most relevant stuff, and also the stuff we currently provide default values for.
For the initial release, we can still handle the "old" way of config, warn when we detect "unknown" config, and still make it work. And then remove this deprecated functionality in the near future.