docs/migration/replay.md
Sentry Replay is now out of Beta. This means that the usual stability guarantees apply.
Because of experimentation and rapid iteration, during the Beta period some bugs and problems came up which have since been fixed/improved. We strongly recommend anyone using Replay in a version before 7.39.0 to update to 7.39.0 or newer, in order to prevent running Replay with known problems that have since been fixed.
Below you can find a list of relevant replay issues that have been resolved until 7.39.0:
autoplay attribute from audio/video tags (#59)<link rel="modulepreload"> (#52)aria-labelflush method to integration (#6776)maskAllInputs:false (#61)rootShadowHost check (#50)maxWait (#7207, #7208)checkoutEveryNms (#6722)maskAllText selector (#6637)This release will remove the ability to change the default rrweb recording options (outside of privacy options). The
following are the new configuration values all replays will use: slimDOMOptions: 'all' - Removes script, comments,
favicon, whitespace in head, and a few meta tags in head recordCanvas: false - This option did not do anything
as playback of recorded canvas means we would have to remove the playback sandbox (which is a security concern).
inlineStylesheet: true - Inlines styles into the recording itself instead of attempting to fetch it remotely. This
means that styles in the replay will reflect the styles at the time of recording and not the current styles of the
remote stylesheet. collectFonts: true - Attempts to load custom fonts. inlineImages: false - Does not inline images
to recording and instead loads the asset remotely. During playback, images may not load due to CORS (add sentry.io as an
origin).
Additionally, we have streamlined the privacy options. The following table lists the deprecated value, and what it is replaced by:
| deprecated key | replaced by | description |
|---|---|---|
| maskInputOptions | mask | Use CSS selectors in mask in order to mask all inputs of a certain type. For example, input[type="address"] |
| blockSelector | block | The selector(s) can be moved directly in the block array. |
| blockClass | block | Convert the class name to a CSS selector and add to block array. For example, first-name becomes .first-name. Regexes can be moved as-is. |
| maskClass | mask | Convert the class name to a CSS selector and add to mask array. For example, first-name becomes .first-name. Regexes can be moved as-is. |
| maskSelector | mask | The selector(s) can be moved directly in the mask array. |
| ignoreClass | ignore | Convert the class name to a CSS selector and add to ignore array. For example, first-name becomes .first-name. Regexes can be moved as-is. |
In 7.32.0, we have removed the default values for the replay sample rates. Previously, they were:
replaysSessionSampleRate: 0.1replaysOnErrorSampleRate: 1.0Now, you have to explicitly set the sample rates, otherwise they default to 0.
The Sentry Replay integration was moved to the Sentry JavaScript SDK monorepo. Hence we're jumping from version 0.x to the monorepo's 7.x version which is shared across all JS SDK packages.
Instead of defining the sample rates on the integration like this:
Sentry.init({
dsn: '__DSN__',
integrations: [
new Replay({
sessionSampleRate: 0.1,
errorSampleRate: 1.0,
}),
],
// ...
});
They are now defined on the top level of the SDK:
Sentry.init({
dsn: '__DSN__',
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
integrations: [
new Replay({
// other replay config still goes in here
}),
],
});
Note that the sample rate options inside of new Replay({}) have been deprecated and will be removed in a future
update.
Two options, which have been deprecated for some time, have been removed:
replaysSamplingRate - instead use sessionSampleRatecaptureOnlyOnError - instead use errorSampleRateThe internal structure of the npm package has changed. This is unlikely to affect you, unless you have imported something from e.g.:
import something from '@sentry/replay/submodule';
If you only imported from @sentry/replay, this will not affect you.
IEventBuffer to EventBuffer (https://github.com/getsentry/sentry-javascript/pull/6416)It is highly unlikely to affect anybody, but the type IEventBuffer was renamed to EventBuffer for consistency.
Unless you manually imported this and used it somewhere in your codebase, this will not affect you.
The Session object exported from Replay is now a plain object, instead of a class. This should not affect you unless
you specifically accessed this class & did custom things with it.
The result of new Replay() now has a much more limited public API. Only the following methods are exposed:
const replay = new Replay();
replay.start();
replay.stop();