@sentry/replay
Advanced tools
Comparing version 8.0.0-alpha.2 to 8.0.0-alpha.3
{ | ||
"name": "@sentry/replay", | ||
"version": "8.0.0-alpha.2", | ||
"version": "8.0.0-alpha.3", | ||
"description": "User replays for Sentry", | ||
@@ -8,2 +8,15 @@ "main": "cjs/index.js", | ||
"types": "types/index.d.ts", | ||
"exports": { | ||
"./package.json": "./package.json", | ||
".": { | ||
"import": { | ||
"types": "./types/index.d.ts", | ||
"default": "./esm/index.js" | ||
}, | ||
"require": { | ||
"types": "./types/index.d.ts", | ||
"default": "./cjs/index.js" | ||
} | ||
} | ||
}, | ||
"typesVersions": { | ||
@@ -35,3 +48,3 @@ "<4.9": { | ||
"@babel/core": "^7.17.5", | ||
"@sentry-internal/replay-worker": "8.0.0-alpha.2", | ||
"@sentry-internal/replay-worker": "8.0.0-alpha.3", | ||
"@sentry-internal/rrweb": "2.11.0", | ||
@@ -43,10 +56,10 @@ "@sentry-internal/rrweb-snapshot": "2.11.0", | ||
"dependencies": { | ||
"@sentry-internal/tracing": "8.0.0-alpha.2", | ||
"@sentry/core": "8.0.0-alpha.2", | ||
"@sentry/types": "8.0.0-alpha.2", | ||
"@sentry/utils": "8.0.0-alpha.2" | ||
"@sentry-internal/tracing": "8.0.0-alpha.3", | ||
"@sentry/core": "8.0.0-alpha.3", | ||
"@sentry/types": "8.0.0-alpha.3", | ||
"@sentry/utils": "8.0.0-alpha.3" | ||
}, | ||
"engines": { | ||
"node": ">=14.8" | ||
"node": ">=14.18" | ||
} | ||
} |
185
README.md
@@ -19,4 +19,4 @@ <p align="center"> | ||
Replay can be imported from `@sentry/browser`, or a respective SDK package like `@sentry/react` or `@sentry/vue`. | ||
You don't need to install anything in order to use Session Replay. The minimum version that includes Replay is 7.27.0. | ||
Replay can be imported from `@sentry/browser`, or a respective SDK package like `@sentry/react` or `@sentry/vue`. You | ||
don't need to install anything in order to use Session Replay. The minimum version that includes Replay is 7.27.0. | ||
@@ -27,4 +27,4 @@ For details on using Replay when using Sentry via the CDN bundles, see [CDN bundle](#loading-replay-as-a-cdn-bundle). | ||
To set up the integration, add the following to your Sentry initialization. Several options are supported and passable via the integration constructor. | ||
See the [configuration section](#configuration) below for more details. | ||
To set up the integration, add the following to your Sentry initialization. Several options are supported and passable | ||
via the integration constructor. See the [configuration section](#configuration) below for more details. | ||
@@ -47,8 +47,8 @@ ```javascript | ||
integrations: [ | ||
new Sentry.Replay({ | ||
Sentry.replayIntegration({ | ||
// Additional SDK configuration goes in here, for example: | ||
maskAllText: true, | ||
blockAllMedia: true | ||
blockAllMedia: true, | ||
// See below for all available options | ||
}) | ||
}), | ||
], | ||
@@ -61,5 +61,4 @@ // ... | ||
Replay will start automatically when you add the integration. | ||
If you do not want to start Replay immediately (e.g. if you want to lazy-load it), | ||
you can also use `addIntegration` to load it later: | ||
Replay will start automatically when you add the integration. If you do not want to start Replay immediately (e.g. if | ||
you want to lazy-load it), you can also use `addIntegration` to load it later: | ||
@@ -80,3 +79,3 @@ ```js | ||
// Client can be undefined | ||
client?.addIntegration(new Replay()); | ||
client?.addIntegration(Sentry.replayIntegration()); | ||
``` | ||
@@ -86,8 +85,10 @@ | ||
If you have only followed the above instructions to setup session replays, you will only see IP addresses in Sentry's UI. In order to associate a user identity to a session replay, use [`setUser`](https://docs.sentry.io/platforms/javascript/enriching-events/identify-user/). | ||
If you have only followed the above instructions to setup session replays, you will only see IP addresses in Sentry's | ||
UI. In order to associate a user identity to a session replay, use | ||
[`setUser`](https://docs.sentry.io/platforms/javascript/enriching-events/identify-user/). | ||
```javascript | ||
import * as Sentry from "@sentry/browser"; | ||
import * as Sentry from '@sentry/browser'; | ||
Sentry.setUser({ email: "jane.doe@example.com" }); | ||
Sentry.setUser({ email: 'jane.doe@example.com' }); | ||
``` | ||
@@ -97,3 +98,4 @@ | ||
Replay recording only starts when it is included in the `integrations` array when calling `Sentry.init` or calling `addIntegration` from the a Sentry client instance. To stop recording you can call `stop()`. | ||
Replay recording only starts when it is included in the `integrations` array when calling `Sentry.init` or calling | ||
`addIntegration` from the a Sentry client instance. To stop recording you can call `stop()`. | ||
@@ -104,3 +106,3 @@ ```js | ||
const replay = new Replay(); | ||
const replay = Sentry.replayIntegration(); | ||
@@ -120,4 +122,4 @@ Sentry.init({ | ||
When both `replaysSessionSampleRate` and `replaysOnErrorSampleRate` are `0`, recording will _not_ start. | ||
In this case, you can manually start recording: | ||
When both `replaysSessionSampleRate` and `replaysOnErrorSampleRate` are `0`, recording will _not_ start. In this case, | ||
you can manually start recording: | ||
@@ -129,8 +131,7 @@ ```js | ||
## Loading Replay as a CDN Bundle | ||
As an alternative to the NPM package, you can use Replay as a CDN bundle. | ||
Please refer to the [Session Replay installation guide](https://docs.sentry.io/platforms/javascript/session-replay/#install) for CDN bundle instructions. | ||
As an alternative to the NPM package, you can use Replay as a CDN bundle. Please refer to the | ||
[Session Replay installation guide](https://docs.sentry.io/platforms/javascript/session-replay/#install) for CDN bundle | ||
instructions. | ||
@@ -144,11 +145,6 @@ <details> | ||
```html | ||
<script | ||
src="https://browser.sentry-cdn.com/7.41.0/bundle.min.js" | ||
crossorigin="anonymous" | ||
></script> | ||
<script | ||
src="https://browser.sentry-cdn.com/7.41.0/replay.min.js" | ||
crossorigin="anonymous" | ||
></script> | ||
<script src="https://browser.sentry-cdn.com/7.41.0/bundle.min.js" crossorigin="anonymous"></script> | ||
<script src="https://browser.sentry-cdn.com/7.41.0/replay.min.js" crossorigin="anonymous"></script> | ||
``` | ||
</details> | ||
@@ -158,3 +154,6 @@ | ||
A session starts when the Session Replay SDK is first loaded and initialized. The session will continue until 5 minutes passes without any user interactions[^1] with the application *OR* until a maximum of 30 minutes have elapsed. Closing the browser tab will end the session immediately according to the rules for [SessionStorage](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage). | ||
A session starts when the Session Replay SDK is first loaded and initialized. The session will continue until 5 minutes | ||
passes without any user interactions[^1] with the application _OR_ until a maximum of 30 minutes have elapsed. Closing | ||
the browser tab will end the session immediately according to the rules for | ||
[SessionStorage](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage). | ||
@@ -165,21 +164,26 @@ [^1]: An 'interaction' refers to either a mouse click or a browser navigation event. | ||
You can get the ID of the currently running session via `replay.getReplayId()`. | ||
This will return `undefined` if no session is ongoing. | ||
You can get the ID of the currently running session via `replay.getReplayId()`. This will return `undefined` if no | ||
session is ongoing. | ||
### Replay Captures Only on Errors | ||
Alternatively, rather than recording an entire session, you can capture a replay only when an error occurs. In this case, the integration will buffer up to one minute worth of events prior to the error being thrown. It will continue to record the session following the rules above regarding session life and activity. Read the [sampling](#Sampling) section for configuration options. | ||
Alternatively, rather than recording an entire session, you can capture a replay only when an error occurs. In this | ||
case, the integration will buffer up to one minute worth of events prior to the error being thrown. It will continue to | ||
record the session following the rules above regarding session life and activity. Read the [sampling](#Sampling) section | ||
for configuration options. | ||
## Sampling | ||
Sampling allows you to control how much of your website's traffic will result in a Session Replay. There are two sample rates you can adjust to get the replays more relevant to your interests: | ||
Sampling allows you to control how much of your website's traffic will result in a Session Replay. There are two sample | ||
rates you can adjust to get the replays more relevant to your interests: | ||
- `replaysSessionSampleRate` - The sample rate for replays that begin recording immediately and last the entirety of the user's session. | ||
- `replaysOnErrorSampleRate` - The sample rate for replays that are recorded when an error happens. This type of replay will record up to a minute of events prior to the error and continue recording until the session ends. | ||
- `replaysSessionSampleRate` - The sample rate for replays that begin recording immediately and last the entirety of the | ||
user's session. | ||
- `replaysOnErrorSampleRate` - The sample rate for replays that are recorded when an error happens. This type of replay | ||
will record up to a minute of events prior to the error and continue recording until the session ends. | ||
When Replay is initialized, we check the `replaysSessionSampleRate`. | ||
If it is sampled, then we start recording & sending Replay data immediately. | ||
Else, if `replaysOnErrorSampleRate > 0`, we'll start recording in buffering mode. | ||
In this mode, whenever an error occurs we'll check `replaysOnErrorSampleRate`. | ||
If it is sampled, when we'll upload the Replay to Sentry and continue recording normally. | ||
When Replay is initialized, we check the `replaysSessionSampleRate`. If it is sampled, then we start recording & sending | ||
Replay data immediately. Else, if `replaysOnErrorSampleRate > 0`, we'll start recording in buffering mode. In this mode, | ||
whenever an error occurs we'll check `replaysOnErrorSampleRate`. If it is sampled, when we'll upload the Replay to | ||
Sentry and continue recording normally. | ||
@@ -192,59 +196,71 @@ ## Configuration | ||
| key | type | default | description | | ||
| ------------------------ | ------ | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| replaysSessionSampleRate | number | `0` | The sample rate for replays that begin recording immediately and last the entirety of the user's session. 1.0 will collect all replays, 0 will collect no replays. | | ||
| replaysOnErrorSampleRate | number | `0` | The sample rate for replays that are recorded when an error happens. This type of replay will record up to a minute of events prior to the error and continue recording until the session ends. 1.0 capturing all sessions with an error, and 0 capturing none. | | ||
| key | type | default | description | | ||
| ------------------- | ------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| replaysSessionSampleRate | number | `0` | The sample rate for replays that begin recording immediately and last the entirety of the user's session. 1.0 will collect all replays, 0 will collect no replays. | | ||
| replaysOnErrorSampleRate | number | `0` |The sample rate for replays that are recorded when an error happens. This type of replay will record up to a minute of events prior to the error and continue recording until the session ends. 1.0 capturing all sessions with an error, and 0 capturing none. | ||
### General Integration Configuration | ||
The following options can be configured as options to the integration, in `new Replay({})`: | ||
The following options can be configured as options to the integration, in `Sentry.replayIntegration({})`: | ||
| key | type | default | description | | ||
| ------------------- | ------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| stickySession | boolean | `true` | Keep track of the user across page loads. Note a single user using multiple tabs will result in multiple sessions. Closing a tab will result in the session being closed as well. | | ||
| key | type | default | description | | ||
| ------------- | ------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| stickySession | boolean | `true` | Keep track of the user across page loads. Note a single user using multiple tabs will result in multiple sessions. Closing a tab will result in the session being closed as well. | | ||
### Privacy Configuration | ||
The following options can be configured as options to the integration, in `new Replay({})`: | ||
The following options can be configured as options to the integration, in `Sentry.replayIntegration({})`: | ||
| key | type | default | description | | ||
| ---------------- | ------------------------ | --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| maskAllText | boolean | `true` | Mask _all_ text content. Will pass text content through `maskFn` before sending to server. | | ||
| maskAllInputs | boolean | `true` | Mask values of `<input>` elements. Passes input values through `maskInputFn` before sending to server. | | ||
| blockAllMedia | boolean | `true` | Block _all_ media elements (`img, svg, video, object, picture, embed, map, audio`) | | ||
| maskFn | (text: string) => string | `(text) => '*'.repeat(text.length)` | Function to customize how text content is masked before sending to server. By default, masks text with `*`. | | ||
| block | Array<string> | `.sentry-block, [data-sentry-block]` | Redact any elements that match the DOM selectors. See [privacy](#blocking) section for an example. | | ||
| unblock | Array<string> | `.sentry-unblock, [data-sentry-unblock]`| Do not redact any elements that match the DOM selectors. Useful when using `blockAllMedia`. See [privacy](#blocking) section for an example. | | ||
| mask | Array<string> | `.sentry-mask, [data-sentry-mask]` | Mask all elements that match the given DOM selectors. See [privacy](#masking) section for an example. | | ||
| unmask | Array<string> | `.sentry-unmask, [data-sentry-unmask]` | Unmask all elements that match the given DOM selectors. Useful when using `maskAllText`. See [privacy](#masking) section for an example. | | ||
| ignore | Array<string> | `.sentry-ignore, [data-sentry-ignore]` | Ignores all events on the matching input fields. See [privacy](#ignoring) section for an example. | | ||
| key | type | default | description | | ||
| ------------- | ------------------------ | -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| maskAllText | boolean | `true` | Mask _all_ text content. Will pass text content through `maskFn` before sending to server. | | ||
| maskAllInputs | boolean | `true` | Mask values of `<input>` elements. Passes input values through `maskInputFn` before sending to server. | | ||
| blockAllMedia | boolean | `true` | Block _all_ media elements (`img, svg, video, object, picture, embed, map, audio`) | | ||
| maskFn | (text: string) => string | `(text) => '*'.repeat(text.length)` | Function to customize how text content is masked before sending to server. By default, masks text with `*`. | | ||
| block | Array<string> | `.sentry-block, [data-sentry-block]` | Redact any elements that match the DOM selectors. See [privacy](#blocking) section for an example. | | ||
| unblock | Array<string> | [] | Do not redact any elements that match the DOM selectors. Useful when using `blockAllMedia`. See [privacy](#blocking) section for an example. | | ||
| mask | Array<string> | `.sentry-mask, [data-sentry-mask]` | Mask all elements that match the given DOM selectors. See [privacy](#masking) section for an example. | | ||
| unmask | Array<string> | [] | Unmask all elements that match the given DOM selectors. Useful when using `maskAllText`. See [privacy](#masking) section for an example. | | ||
| ignore | Array<string> | `.sentry-ignore, [data-sentry-ignore]` | Ignores all events on the matching input fields. See [privacy](#ignoring) section for an example. | | ||
#### Deprecated options | ||
In order to streamline our privacy options, the following have been deprecated in favor for the respective options above. | ||
| 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. | | ||
In order to streamline our privacy options, the following have been deprecated in favor for the respective options | ||
above. | ||
| 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. | | ||
## Privacy | ||
There are several ways to deal with PII. By default, the integration will mask all text content with `*` and block all media elements (`img, svg, video, object, picture, embed, map, audio`). This can be disabled by setting `maskAllText` to `false`. It is also possible to add the following CSS classes to specific DOM elements to prevent recording its contents: `sentry-block`, `sentry-ignore`, and `sentry-mask`. The following sections will show examples of how content is handled by the differing methods. | ||
There are several ways to deal with PII. By default, the integration will mask all text content with `*` and block all | ||
media elements (`img, svg, video, object, picture, embed, map, audio`). This can be disabled by setting `maskAllText` to | ||
`false`. It is also possible to add the following CSS classes to specific DOM elements to prevent recording its | ||
contents: `sentry-block`, `sentry-ignore`, and `sentry-mask`. The following sections will show examples of how content | ||
is handled by the differing methods. | ||
### Masking | ||
Masking replaces the text content with something else. The default masking behavior is to replace each character with a `*`. In this example the relevant html code is: `<table class="sentry-mask">...</table>`. | ||
Masking replaces the text content with something else. The default masking behavior is to replace each character with a | ||
`*`. In this example the relevant html code is: `<table class="sentry-mask">...</table>`. | ||
![Masking example](https://user-images.githubusercontent.com/79684/193118192-dee1d3d8-5813-47e8-b532-f9ee1c8714b3.png) | ||
### Blocking | ||
Blocking replaces the element with a placeholder that has the same dimensions. The recording will show an empty space where the content was. In this example the relevant html code is: `<table data-sentry-block>...</table>`. | ||
Blocking replaces the element with a placeholder that has the same dimensions. The recording will show an empty space | ||
where the content was. In this example the relevant html code is: `<table data-sentry-block>...</table>`. | ||
![Blocking example](https://user-images.githubusercontent.com/79684/193118084-51a589fc-2160-476a-a8dc-b681eddb136c.png) | ||
### Ignoring | ||
Ignoring only applies to form inputs. Events will be ignored on the input element so that the replay does not show what occurs inside of the input. In the below example, notice how the results in the table below the input changes, but no text is visible in the input. | ||
Ignoring only applies to form inputs. Events will be ignored on the input element so that the replay does not show what | ||
occurs inside of the input. In the below example, notice how the results in the table below the input changes, but no | ||
text is visible in the input. | ||
https://user-images.githubusercontent.com/79684/192815134-a6451c3f-d3cb-455f-a699-7c3fe04d0a2e.mov | ||
@@ -254,13 +270,12 @@ | ||
Currently, errors that happen on the page while a replay is running are linked to the Replay, | ||
making it as easy as possible to jump between related issues/replays. | ||
However, please note that it is _possible_ that the error count reported on the Replay Detail page | ||
does not match the actual errors that have been captured. | ||
The reason for that is that errors _can_ be lost, e.g. a network request fails, or similar. | ||
This should not happen to often, but be aware that it is theoretically possible. | ||
Currently, errors that happen on the page while a replay is running are linked to the Replay, making it as easy as | ||
possible to jump between related issues/replays. However, please note that it is _possible_ that the error count | ||
reported on the Replay Detail page does not match the actual errors that have been captured. The reason for that is that | ||
errors _can_ be lost, e.g. a network request fails, or similar. This should not happen to often, but be aware that it is | ||
theoretically possible. | ||
## Manually sending replay data | ||
You can use `replay.flush()` to immediately send all currently captured replay data. | ||
When Replay is currently in buffering mode, this will send up to the last 60 seconds of replay data, | ||
and also continue sending afterwards, similar to when an error happens & is recorded. | ||
You can use `replay.flush()` to immediately send all currently captured replay data. When Replay is currently in | ||
buffering mode, this will send up to the last 60 seconds of replay data, and also continue sending afterwards, similar | ||
to when an error happens & is recorded. |
@@ -1,2 +0,2 @@ | ||
export { Replay, replayIntegration, } from './integration'; | ||
export { replayIntegration } from './integration'; | ||
export { ReplayConfiguration, ReplayEventType, ReplayEventWithTime, ReplayBreadcrumbFrame, ReplayBreadcrumbFrameEvent, ReplayOptionFrameEvent, ReplayFrame, ReplayFrameEvent, ReplaySpanFrame, ReplaySpanFrameEvent, CanvasManagerInterface, CanvasManagerOptions, } from './types'; | ||
@@ -3,0 +3,0 @@ export { getReplay } from './util/getReplay'; |
import { Integration } from '@sentry/types'; | ||
import { ReplayConfiguration, SendBufferedReplayOptions } from './types'; | ||
/** | ||
* Sentry integration for [Session Replay](https://sentry.io/for/session-replay/). | ||
* | ||
* See the [Replay documentation](https://docs.sentry.io/platforms/javascript/guides/session-replay/) for more information. | ||
* | ||
* @example | ||
* | ||
* ``` | ||
* Sentry.init({ | ||
* dsn: '__DSN__', | ||
* integrations: [Sentry.replayIntegration()], | ||
* }); | ||
* ``` | ||
*/ | ||
export declare const replayIntegration: (options?: ReplayConfiguration) => Replay; | ||
/** | ||
* The main replay integration class, to be passed to `init({ integrations: [] })`. | ||
* @deprecated Use `replayIntegration()` instead. | ||
* Replay integration | ||
* | ||
* TODO: Rewrite this to be functional integration | ||
* Exported for tests. | ||
*/ | ||
@@ -30,3 +46,3 @@ export declare class Replay implements Integration { | ||
private _replay?; | ||
constructor({ flushMinDelay, flushMaxDelay, minReplayDuration, maxReplayDuration, stickySession, useCompression, workerUrl, _experiments, sessionSampleRate, errorSampleRate, maskAllText, maskAllInputs, blockAllMedia, mutationBreadcrumbLimit, mutationLimit, slowClickTimeout, slowClickIgnoreSelectors, networkDetailAllowUrls, networkDetailDenyUrls, networkCaptureBodies, networkRequestHeaders, networkResponseHeaders, mask, maskAttributes, unmask, block, unblock, ignore, maskFn, beforeAddRecordingEvent, beforeErrorSampling, blockClass, blockSelector, maskInputOptions, maskTextClass, maskTextSelector, ignoreClass, }?: ReplayConfiguration); | ||
constructor({ flushMinDelay, flushMaxDelay, minReplayDuration, maxReplayDuration, stickySession, useCompression, workerUrl, _experiments, maskAllText, maskAllInputs, blockAllMedia, mutationBreadcrumbLimit, mutationLimit, slowClickTimeout, slowClickIgnoreSelectors, networkDetailAllowUrls, networkDetailDenyUrls, networkCaptureBodies, networkRequestHeaders, networkResponseHeaders, mask, maskAttributes, unmask, block, unblock, ignore, maskFn, beforeAddRecordingEvent, beforeErrorSampling, blockClass, blockSelector, maskInputOptions, maskTextClass, maskTextSelector, ignoreClass, }?: ReplayConfiguration); | ||
/*If replay has already been initialized | ||
@@ -33,0 +49,0 @@ Update _isInitialized */ |
@@ -1,2 +0,2 @@ | ||
import { ReplayRecordingMode, Transaction } from '@sentry/types'; | ||
import { ReplayRecordingMode, Span } from '@sentry/types'; | ||
import { ClickDetector } from './coreHandlers/handleClick'; | ||
@@ -24,6 +24,6 @@ import { AddEventResult, AddUpdateCallback, AllPerformanceEntry, AllPerformanceEntryData, EventBuffer, InternalEventContext, RecordingEvent, RecordingOptions, ReplayContainer as ReplayContainerInterface, ReplayPerformanceEntry, ReplayPluginOptions, SendBufferedReplayOptions, Session, Timeouts } from './types'; | ||
/** | ||
* The current or last active transcation. | ||
* The current or last active span. | ||
* This is only available when performance is enabled. | ||
*/ | ||
lastTransaction?: Transaction; | ||
lastActiveSpan?: Span; | ||
/** | ||
@@ -30,0 +30,0 @@ * These are here so we can overwrite them in tests etc. |
@@ -1,2 +0,2 @@ | ||
import { Breadcrumb, ErrorEvent, FetchBreadcrumbHint, HandlerDataFetch, ReplayRecordingData, ReplayRecordingMode, SentryWrappedXMLHttpRequest, Transaction, XhrBreadcrumbHint } from '@sentry/types'; | ||
import { Breadcrumb, ErrorEvent, FetchBreadcrumbHint, HandlerDataFetch, ReplayRecordingData, ReplayRecordingMode, SentryWrappedXMLHttpRequest, Span, XhrBreadcrumbHint } from '@sentry/types'; | ||
import { SKIPPED, THROTTLED } from '../util/throttle'; | ||
@@ -196,2 +196,13 @@ import { AllPerformanceEntry, AllPerformanceEntryData, ReplayPerformanceEntry } from './performance'; | ||
/** | ||
* The options that can be set in the plugin options. `sessionSampleRate` and `errorSampleRate` are added | ||
* in the root level of the SDK options as `replaysSessionSampleRate` and `replaysOnErrorSampleRate`. | ||
*/ | ||
export type InitialReplayPluginOptions = Pick<ReplayPluginOptions, Exclude<keyof ReplayPluginOptions, 'sessionSampleRate' | 'errorSampleRate'>>; | ||
type OptionalReplayPluginOptions = Partial<InitialReplayPluginOptions> & { | ||
/** | ||
* Mask element attributes that are contained in list | ||
*/ | ||
maskAttributes?: string[]; | ||
}; | ||
/** | ||
* Session options that are configurable by the integration configuration | ||
@@ -234,8 +245,2 @@ */ | ||
} | ||
type OptionalReplayPluginOptions = Partial<ReplayPluginOptions> & { | ||
/** | ||
* Mask element attributes that are contained in list | ||
*/ | ||
maskAttributes?: string[]; | ||
}; | ||
export interface DeprecatedPrivacyOptions { | ||
@@ -398,3 +403,3 @@ /** | ||
timeouts: Timeouts; | ||
lastTransaction?: Transaction; | ||
lastActiveSpan?: Span; | ||
throttledAddEvent: (event: RecordingEvent, isCheckout?: boolean) => typeof THROTTLED | typeof SKIPPED | Promise<AddEventResult | null>; | ||
@@ -401,0 +406,0 @@ isEnabled(): boolean; |
@@ -1,2 +0,2 @@ | ||
export { Replay, replayIntegration, } from './integration'; | ||
export { replayIntegration } from './integration'; | ||
export type { ReplayConfiguration, ReplayEventType, ReplayEventWithTime, ReplayBreadcrumbFrame, ReplayBreadcrumbFrameEvent, ReplayOptionFrameEvent, ReplayFrame, ReplayFrameEvent, ReplaySpanFrame, ReplaySpanFrameEvent, CanvasManagerInterface, CanvasManagerOptions, } from './types'; | ||
@@ -3,0 +3,0 @@ export { getReplay } from './util/getReplay'; |
import type { Integration } from '@sentry/types'; | ||
import type { ReplayConfiguration, SendBufferedReplayOptions } from './types'; | ||
/** | ||
* Sentry integration for [Session Replay](https://sentry.io/for/session-replay/). | ||
* | ||
* See the [Replay documentation](https://docs.sentry.io/platforms/javascript/guides/session-replay/) for more information. | ||
* | ||
* @example | ||
* | ||
* ``` | ||
* Sentry.init({ | ||
* dsn: '__DSN__', | ||
* integrations: [Sentry.replayIntegration()], | ||
* }); | ||
* ``` | ||
*/ | ||
export declare const replayIntegration: (options?: ReplayConfiguration) => Replay; | ||
/** | ||
* The main replay integration class, to be passed to `init({ integrations: [] })`. | ||
* @deprecated Use `replayIntegration()` instead. | ||
* Replay integration | ||
* | ||
* TODO: Rewrite this to be functional integration | ||
* Exported for tests. | ||
*/ | ||
@@ -30,3 +46,3 @@ export declare class Replay implements Integration { | ||
private _replay?; | ||
constructor({ flushMinDelay, flushMaxDelay, minReplayDuration, maxReplayDuration, stickySession, useCompression, workerUrl, _experiments, sessionSampleRate, errorSampleRate, maskAllText, maskAllInputs, blockAllMedia, mutationBreadcrumbLimit, mutationLimit, slowClickTimeout, slowClickIgnoreSelectors, networkDetailAllowUrls, networkDetailDenyUrls, networkCaptureBodies, networkRequestHeaders, networkResponseHeaders, mask, maskAttributes, unmask, block, unblock, ignore, maskFn, beforeAddRecordingEvent, beforeErrorSampling, blockClass, blockSelector, maskInputOptions, maskTextClass, maskTextSelector, ignoreClass, }?: ReplayConfiguration); | ||
constructor({ flushMinDelay, flushMaxDelay, minReplayDuration, maxReplayDuration, stickySession, useCompression, workerUrl, _experiments, maskAllText, maskAllInputs, blockAllMedia, mutationBreadcrumbLimit, mutationLimit, slowClickTimeout, slowClickIgnoreSelectors, networkDetailAllowUrls, networkDetailDenyUrls, networkCaptureBodies, networkRequestHeaders, networkResponseHeaders, mask, maskAttributes, unmask, block, unblock, ignore, maskFn, beforeAddRecordingEvent, beforeErrorSampling, blockClass, blockSelector, maskInputOptions, maskTextClass, maskTextSelector, ignoreClass, }?: ReplayConfiguration); | ||
/** If replay has already been initialized */ | ||
@@ -33,0 +49,0 @@ protected get _isInitialized(): boolean; |
@@ -1,2 +0,2 @@ | ||
import type { ReplayRecordingMode, Transaction } from '@sentry/types'; | ||
import type { ReplayRecordingMode, Span } from '@sentry/types'; | ||
import { ClickDetector } from './coreHandlers/handleClick'; | ||
@@ -24,6 +24,6 @@ import type { AddEventResult, AddUpdateCallback, AllPerformanceEntry, AllPerformanceEntryData, EventBuffer, InternalEventContext, RecordingEvent, RecordingOptions, ReplayContainer as ReplayContainerInterface, ReplayPerformanceEntry, ReplayPluginOptions, SendBufferedReplayOptions, Session, Timeouts } from './types'; | ||
/** | ||
* The current or last active transcation. | ||
* The current or last active span. | ||
* This is only available when performance is enabled. | ||
*/ | ||
lastTransaction?: Transaction; | ||
lastActiveSpan?: Span; | ||
/** | ||
@@ -30,0 +30,0 @@ * These are here so we can overwrite them in tests etc. |
@@ -1,2 +0,2 @@ | ||
import type { Breadcrumb, ErrorEvent, FetchBreadcrumbHint, HandlerDataFetch, ReplayRecordingData, ReplayRecordingMode, SentryWrappedXMLHttpRequest, Transaction, XhrBreadcrumbHint } from '@sentry/types'; | ||
import type { Breadcrumb, ErrorEvent, FetchBreadcrumbHint, HandlerDataFetch, ReplayRecordingData, ReplayRecordingMode, SentryWrappedXMLHttpRequest, Span, XhrBreadcrumbHint } from '@sentry/types'; | ||
import type { SKIPPED, THROTTLED } from '../util/throttle'; | ||
@@ -196,2 +196,13 @@ import type { AllPerformanceEntry, AllPerformanceEntryData, ReplayPerformanceEntry } from './performance'; | ||
/** | ||
* The options that can be set in the plugin options. `sessionSampleRate` and `errorSampleRate` are added | ||
* in the root level of the SDK options as `replaysSessionSampleRate` and `replaysOnErrorSampleRate`. | ||
*/ | ||
export type InitialReplayPluginOptions = Omit<ReplayPluginOptions, 'sessionSampleRate' | 'errorSampleRate'>; | ||
type OptionalReplayPluginOptions = Partial<InitialReplayPluginOptions> & { | ||
/** | ||
* Mask element attributes that are contained in list | ||
*/ | ||
maskAttributes?: string[]; | ||
}; | ||
/** | ||
* Session options that are configurable by the integration configuration | ||
@@ -234,8 +245,2 @@ */ | ||
} | ||
type OptionalReplayPluginOptions = Partial<ReplayPluginOptions> & { | ||
/** | ||
* Mask element attributes that are contained in list | ||
*/ | ||
maskAttributes?: string[]; | ||
}; | ||
export interface DeprecatedPrivacyOptions { | ||
@@ -398,3 +403,3 @@ /** | ||
timeouts: Timeouts; | ||
lastTransaction?: Transaction; | ||
lastActiveSpan?: Span; | ||
throttledAddEvent: (event: RecordingEvent, isCheckout?: boolean) => typeof THROTTLED | typeof SKIPPED | Promise<AddEventResult | null>; | ||
@@ -401,0 +406,0 @@ isEnabled(): boolean; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
224
21240
267
3679693
+ Added@sentry-internal/tracing@8.0.0-alpha.3(transitive)
+ Added@sentry/core@8.0.0-alpha.3(transitive)
+ Added@sentry/types@8.0.0-alpha.3(transitive)
+ Added@sentry/utils@8.0.0-alpha.3(transitive)
- Removed@sentry-internal/tracing@8.0.0-alpha.2(transitive)
- Removed@sentry/core@8.0.0-alpha.2(transitive)
- Removed@sentry/types@8.0.0-alpha.2(transitive)
- Removed@sentry/utils@8.0.0-alpha.2(transitive)
Updated@sentry/core@8.0.0-alpha.3
Updated@sentry/types@8.0.0-alpha.3
Updated@sentry/utils@8.0.0-alpha.3