@elenjical-ai/replay 0.0.0-stage → 10.76.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +256 -2
- package/build/npm/cjs/index.js +8519 -0
- package/build/npm/cjs/index.js.map +1 -0
- package/build/npm/cjs/worker-bundler.js +1 -0
- package/build/npm/esm/index.js +8516 -0
- package/build/npm/esm/index.js.map +1 -0
- package/build/npm/esm/package.json +1 -0
- package/build/npm/esm/worker-bundler.js +1 -0
- package/build/npm/types/constants.d.ts +28 -0
- package/build/npm/types/constants.d.ts.map +1 -0
- package/build/npm/types/coreHandlers/handleAfterSendEvent.d.ts +9 -0
- package/build/npm/types/coreHandlers/handleAfterSendEvent.d.ts.map +1 -0
- package/build/npm/types/coreHandlers/handleBeforeSendEvent.d.ts +9 -0
- package/build/npm/types/coreHandlers/handleBeforeSendEvent.d.ts.map +1 -0
- package/build/npm/types/coreHandlers/handleBreadcrumbs.d.ts +14 -0
- package/build/npm/types/coreHandlers/handleBreadcrumbs.d.ts.map +1 -0
- package/build/npm/types/coreHandlers/handleClick.d.ts +47 -0
- package/build/npm/types/coreHandlers/handleClick.d.ts.map +1 -0
- package/build/npm/types/coreHandlers/handleDom.d.ts +11 -0
- package/build/npm/types/coreHandlers/handleDom.d.ts.map +1 -0
- package/build/npm/types/coreHandlers/handleGlobalEvent.d.ts +7 -0
- package/build/npm/types/coreHandlers/handleGlobalEvent.d.ts.map +1 -0
- package/build/npm/types/coreHandlers/handleHistory.d.ts +7 -0
- package/build/npm/types/coreHandlers/handleHistory.d.ts.map +1 -0
- package/build/npm/types/coreHandlers/handleKeyboardEvent.d.ts +7 -0
- package/build/npm/types/coreHandlers/handleKeyboardEvent.d.ts.map +1 -0
- package/build/npm/types/coreHandlers/handleNetworkBreadcrumbs.d.ts +16 -0
- package/build/npm/types/coreHandlers/handleNetworkBreadcrumbs.d.ts.map +1 -0
- package/build/npm/types/coreHandlers/handleProcessSegmentSpan.d.ts +6 -0
- package/build/npm/types/coreHandlers/handleProcessSegmentSpan.d.ts.map +1 -0
- package/build/npm/types/coreHandlers/performanceObserver.d.ts +7 -0
- package/build/npm/types/coreHandlers/performanceObserver.d.ts.map +1 -0
- package/build/npm/types/coreHandlers/util/addBreadcrumbEvent.d.ts +7 -0
- package/build/npm/types/coreHandlers/util/addBreadcrumbEvent.d.ts.map +1 -0
- package/build/npm/types/coreHandlers/util/addFeedbackBreadcrumb.d.ts +7 -0
- package/build/npm/types/coreHandlers/util/addFeedbackBreadcrumb.d.ts.map +1 -0
- package/build/npm/types/coreHandlers/util/addNetworkBreadcrumb.d.ts +4 -0
- package/build/npm/types/coreHandlers/util/addNetworkBreadcrumb.d.ts.map +1 -0
- package/build/npm/types/coreHandlers/util/addSegmentDetailsToContext.d.ts +3 -0
- package/build/npm/types/coreHandlers/util/addSegmentDetailsToContext.d.ts.map +1 -0
- package/build/npm/types/coreHandlers/util/domUtils.d.ts +15 -0
- package/build/npm/types/coreHandlers/util/domUtils.d.ts.map +1 -0
- package/build/npm/types/coreHandlers/util/fetchUtils.d.ts +23 -0
- package/build/npm/types/coreHandlers/util/fetchUtils.d.ts.map +1 -0
- package/build/npm/types/coreHandlers/util/getAttributesToRecord.d.ts +11 -0
- package/build/npm/types/coreHandlers/util/getAttributesToRecord.d.ts.map +1 -0
- package/build/npm/types/coreHandlers/util/networkUtils.d.ts +21 -0
- package/build/npm/types/coreHandlers/util/networkUtils.d.ts.map +1 -0
- package/build/npm/types/coreHandlers/util/onWindowOpen.d.ts +8 -0
- package/build/npm/types/coreHandlers/util/onWindowOpen.d.ts.map +1 -0
- package/build/npm/types/coreHandlers/util/shouldSampleForBufferEvent.d.ts +9 -0
- package/build/npm/types/coreHandlers/util/shouldSampleForBufferEvent.d.ts.map +1 -0
- package/build/npm/types/coreHandlers/util/xhrUtils.d.ts +33 -0
- package/build/npm/types/coreHandlers/util/xhrUtils.d.ts.map +1 -0
- package/build/npm/types/debug-build.d.ts +7 -0
- package/build/npm/types/debug-build.d.ts.map +1 -0
- package/build/npm/types/eventBuffer/EventBufferArray.d.ts +30 -0
- package/build/npm/types/eventBuffer/EventBufferArray.d.ts.map +1 -0
- package/build/npm/types/eventBuffer/EventBufferCompressionWorker.d.ts +52 -0
- package/build/npm/types/eventBuffer/EventBufferCompressionWorker.d.ts.map +1 -0
- package/build/npm/types/eventBuffer/EventBufferProxy.d.ts +47 -0
- package/build/npm/types/eventBuffer/EventBufferProxy.d.ts.map +1 -0
- package/build/npm/types/eventBuffer/WorkerHandler.d.ts +29 -0
- package/build/npm/types/eventBuffer/WorkerHandler.d.ts.map +1 -0
- package/build/npm/types/eventBuffer/error.d.ts +9 -0
- package/build/npm/types/eventBuffer/error.d.ts.map +1 -0
- package/build/npm/types/eventBuffer/index.d.ts +11 -0
- package/build/npm/types/eventBuffer/index.d.ts.map +1 -0
- package/build/npm/types/index.d.ts +4 -0
- package/build/npm/types/index.d.ts.map +1 -0
- package/build/npm/types/integration.d.ts +118 -0
- package/build/npm/types/integration.d.ts.map +1 -0
- package/build/npm/types/replay.d.ts +320 -0
- package/build/npm/types/replay.d.ts.map +1 -0
- package/build/npm/types/session/Session.d.ts +8 -0
- package/build/npm/types/session/Session.d.ts.map +1 -0
- package/build/npm/types/session/clearSession.d.ts +6 -0
- package/build/npm/types/session/clearSession.d.ts.map +1 -0
- package/build/npm/types/session/createSession.d.ts +14 -0
- package/build/npm/types/session/createSession.d.ts.map +1 -0
- package/build/npm/types/session/fetchSession.d.ts +6 -0
- package/build/npm/types/session/fetchSession.d.ts.map +1 -0
- package/build/npm/types/session/loadOrCreateSession.d.ts +11 -0
- package/build/npm/types/session/loadOrCreateSession.d.ts.map +1 -0
- package/build/npm/types/session/saveSession.d.ts +6 -0
- package/build/npm/types/session/saveSession.d.ts.map +1 -0
- package/build/npm/types/session/shouldRefreshSession.d.ts +7 -0
- package/build/npm/types/session/shouldRefreshSession.d.ts.map +1 -0
- package/build/npm/types/types/index.d.ts +6 -0
- package/build/npm/types/types/index.d.ts.map +1 -0
- package/build/npm/types/types/performance.d.ts +136 -0
- package/build/npm/types/types/performance.d.ts.map +1 -0
- package/build/npm/types/types/replay.d.ts +493 -0
- package/build/npm/types/types/replay.d.ts.map +1 -0
- package/build/npm/types/types/replayFrame.d.ts +188 -0
- package/build/npm/types/types/replayFrame.d.ts.map +1 -0
- package/build/npm/types/types/request.d.ts +15 -0
- package/build/npm/types/types/request.d.ts.map +1 -0
- package/build/npm/types/types/rrweb.d.ts +64 -0
- package/build/npm/types/types/rrweb.d.ts.map +1 -0
- package/build/npm/types/util/addEvent.d.ts +20 -0
- package/build/npm/types/util/addEvent.d.ts.map +1 -0
- package/build/npm/types/util/addGlobalListeners.d.ts +6 -0
- package/build/npm/types/util/addGlobalListeners.d.ts.map +1 -0
- package/build/npm/types/util/addMemoryEntry.d.ts +7 -0
- package/build/npm/types/util/addMemoryEntry.d.ts.map +1 -0
- package/build/npm/types/util/createBreadcrumb.d.ts +6 -0
- package/build/npm/types/util/createBreadcrumb.d.ts.map +1 -0
- package/build/npm/types/util/createPerformanceEntries.d.ts +52 -0
- package/build/npm/types/util/createPerformanceEntries.d.ts.map +1 -0
- package/build/npm/types/util/createPerformanceSpans.d.ts +6 -0
- package/build/npm/types/util/createPerformanceSpans.d.ts.map +1 -0
- package/build/npm/types/util/createReplayEnvelope.d.ts +7 -0
- package/build/npm/types/util/createReplayEnvelope.d.ts.map +1 -0
- package/build/npm/types/util/debounce.d.ts +30 -0
- package/build/npm/types/util/debounce.d.ts.map +1 -0
- package/build/npm/types/util/eventUtils.d.ts +10 -0
- package/build/npm/types/util/eventUtils.d.ts.map +1 -0
- package/build/npm/types/util/getPrivacyOptions.d.ts +17 -0
- package/build/npm/types/util/getPrivacyOptions.d.ts.map +1 -0
- package/build/npm/types/util/getRecordingSamplingOptions.d.ts +10 -0
- package/build/npm/types/util/getRecordingSamplingOptions.d.ts.map +1 -0
- package/build/npm/types/util/getReplay.d.ts +6 -0
- package/build/npm/types/util/getReplay.d.ts.map +1 -0
- package/build/npm/types/util/handleRecordingEmit.d.ts +15 -0
- package/build/npm/types/util/handleRecordingEmit.d.ts.map +1 -0
- package/build/npm/types/util/hasSessionStorage.d.ts +3 -0
- package/build/npm/types/util/hasSessionStorage.d.ts.map +1 -0
- package/build/npm/types/util/isExpired.d.ts +6 -0
- package/build/npm/types/util/isExpired.d.ts.map +1 -0
- package/build/npm/types/util/isRrwebError.d.ts +6 -0
- package/build/npm/types/util/isRrwebError.d.ts.map +1 -0
- package/build/npm/types/util/isSampled.d.ts +8 -0
- package/build/npm/types/util/isSampled.d.ts.map +1 -0
- package/build/npm/types/util/isSessionExpired.d.ts +10 -0
- package/build/npm/types/util/isSessionExpired.d.ts.map +1 -0
- package/build/npm/types/util/logger.d.ts +24 -0
- package/build/npm/types/util/logger.d.ts.map +1 -0
- package/build/npm/types/util/maskAttribute.d.ts +17 -0
- package/build/npm/types/util/maskAttribute.d.ts.map +1 -0
- package/build/npm/types/util/prepareRecordingData.d.ts +9 -0
- package/build/npm/types/util/prepareRecordingData.d.ts.map +1 -0
- package/build/npm/types/util/prepareReplayEvent.d.ts +11 -0
- package/build/npm/types/util/prepareReplayEvent.d.ts.map +1 -0
- package/build/npm/types/util/resetReplayIdOnDynamicSamplingContext.d.ts +14 -0
- package/build/npm/types/util/resetReplayIdOnDynamicSamplingContext.d.ts.map +1 -0
- package/build/npm/types/util/rrweb.d.ts +7 -0
- package/build/npm/types/util/rrweb.d.ts.map +1 -0
- package/build/npm/types/util/sendReplay.d.ts +9 -0
- package/build/npm/types/util/sendReplay.d.ts.map +1 -0
- package/build/npm/types/util/sendReplayRequest.d.ts +27 -0
- package/build/npm/types/util/sendReplayRequest.d.ts.map +1 -0
- package/build/npm/types/util/shouldFilterRequest.d.ts +7 -0
- package/build/npm/types/util/shouldFilterRequest.d.ts.map +1 -0
- package/build/npm/types/util/throttle.d.ts +12 -0
- package/build/npm/types/util/throttle.d.ts.map +1 -0
- package/build/npm/types/util/timestamp.d.ts +9 -0
- package/build/npm/types/util/timestamp.d.ts.map +1 -0
- package/build/npm/types/worker-bundler.d.ts +2 -0
- package/build/npm/types/worker-bundler.d.ts.map +1 -0
- package/build/npm/types-ts3.8/constants.d.ts +28 -0
- package/build/npm/types-ts3.8/coreHandlers/handleAfterSendEvent.d.ts +9 -0
- package/build/npm/types-ts3.8/coreHandlers/handleBeforeSendEvent.d.ts +9 -0
- package/build/npm/types-ts3.8/coreHandlers/handleBreadcrumbs.d.ts +14 -0
- package/build/npm/types-ts3.8/coreHandlers/handleClick.d.ts +47 -0
- package/build/npm/types-ts3.8/coreHandlers/handleDom.d.ts +11 -0
- package/build/npm/types-ts3.8/coreHandlers/handleGlobalEvent.d.ts +7 -0
- package/build/npm/types-ts3.8/coreHandlers/handleHistory.d.ts +7 -0
- package/build/npm/types-ts3.8/coreHandlers/handleKeyboardEvent.d.ts +7 -0
- package/build/npm/types-ts3.8/coreHandlers/handleNetworkBreadcrumbs.d.ts +16 -0
- package/build/npm/types-ts3.8/coreHandlers/handleProcessSegmentSpan.d.ts +6 -0
- package/build/npm/types-ts3.8/coreHandlers/performanceObserver.d.ts +7 -0
- package/build/npm/types-ts3.8/coreHandlers/util/addBreadcrumbEvent.d.ts +7 -0
- package/build/npm/types-ts3.8/coreHandlers/util/addFeedbackBreadcrumb.d.ts +7 -0
- package/build/npm/types-ts3.8/coreHandlers/util/addNetworkBreadcrumb.d.ts +4 -0
- package/build/npm/types-ts3.8/coreHandlers/util/addSegmentDetailsToContext.d.ts +3 -0
- package/build/npm/types-ts3.8/coreHandlers/util/domUtils.d.ts +15 -0
- package/build/npm/types-ts3.8/coreHandlers/util/fetchUtils.d.ts +23 -0
- package/build/npm/types-ts3.8/coreHandlers/util/getAttributesToRecord.d.ts +11 -0
- package/build/npm/types-ts3.8/coreHandlers/util/networkUtils.d.ts +21 -0
- package/build/npm/types-ts3.8/coreHandlers/util/onWindowOpen.d.ts +8 -0
- package/build/npm/types-ts3.8/coreHandlers/util/shouldSampleForBufferEvent.d.ts +9 -0
- package/build/npm/types-ts3.8/coreHandlers/util/xhrUtils.d.ts +36 -0
- package/build/npm/types-ts3.8/debug-build.d.ts +7 -0
- package/build/npm/types-ts3.8/eventBuffer/EventBufferArray.d.ts +30 -0
- package/build/npm/types-ts3.8/eventBuffer/EventBufferCompressionWorker.d.ts +52 -0
- package/build/npm/types-ts3.8/eventBuffer/EventBufferProxy.d.ts +45 -0
- package/build/npm/types-ts3.8/eventBuffer/WorkerHandler.d.ts +29 -0
- package/build/npm/types-ts3.8/eventBuffer/error.d.ts +9 -0
- package/build/npm/types-ts3.8/eventBuffer/index.d.ts +11 -0
- package/build/npm/types-ts3.8/index.d.ts +4 -0
- package/build/npm/types-ts3.8/integration.d.ts +117 -0
- package/build/npm/types-ts3.8/replay.d.ts +320 -0
- package/build/npm/types-ts3.8/session/Session.d.ts +8 -0
- package/build/npm/types-ts3.8/session/clearSession.d.ts +6 -0
- package/build/npm/types-ts3.8/session/createSession.d.ts +14 -0
- package/build/npm/types-ts3.8/session/fetchSession.d.ts +6 -0
- package/build/npm/types-ts3.8/session/loadOrCreateSession.d.ts +11 -0
- package/build/npm/types-ts3.8/session/saveSession.d.ts +6 -0
- package/build/npm/types-ts3.8/session/shouldRefreshSession.d.ts +7 -0
- package/build/npm/types-ts3.8/types/index.d.ts +6 -0
- package/build/npm/types-ts3.8/types/performance.d.ts +136 -0
- package/build/npm/types-ts3.8/types/replay.d.ts +493 -0
- package/build/npm/types-ts3.8/types/replayFrame.d.ts +188 -0
- package/build/npm/types-ts3.8/types/request.d.ts +15 -0
- package/build/npm/types-ts3.8/types/rrweb.d.ts +64 -0
- package/build/npm/types-ts3.8/util/addEvent.d.ts +20 -0
- package/build/npm/types-ts3.8/util/addGlobalListeners.d.ts +6 -0
- package/build/npm/types-ts3.8/util/addMemoryEntry.d.ts +7 -0
- package/build/npm/types-ts3.8/util/createBreadcrumb.d.ts +6 -0
- package/build/npm/types-ts3.8/util/createPerformanceEntries.d.ts +52 -0
- package/build/npm/types-ts3.8/util/createPerformanceSpans.d.ts +6 -0
- package/build/npm/types-ts3.8/util/createReplayEnvelope.d.ts +7 -0
- package/build/npm/types-ts3.8/util/debounce.d.ts +30 -0
- package/build/npm/types-ts3.8/util/eventUtils.d.ts +10 -0
- package/build/npm/types-ts3.8/util/getPrivacyOptions.d.ts +17 -0
- package/build/npm/types-ts3.8/util/getRecordingSamplingOptions.d.ts +10 -0
- package/build/npm/types-ts3.8/util/getReplay.d.ts +6 -0
- package/build/npm/types-ts3.8/util/handleRecordingEmit.d.ts +15 -0
- package/build/npm/types-ts3.8/util/hasSessionStorage.d.ts +3 -0
- package/build/npm/types-ts3.8/util/isExpired.d.ts +6 -0
- package/build/npm/types-ts3.8/util/isRrwebError.d.ts +6 -0
- package/build/npm/types-ts3.8/util/isSampled.d.ts +8 -0
- package/build/npm/types-ts3.8/util/isSessionExpired.d.ts +10 -0
- package/build/npm/types-ts3.8/util/logger.d.ts +24 -0
- package/build/npm/types-ts3.8/util/maskAttribute.d.ts +17 -0
- package/build/npm/types-ts3.8/util/prepareRecordingData.d.ts +9 -0
- package/build/npm/types-ts3.8/util/prepareReplayEvent.d.ts +11 -0
- package/build/npm/types-ts3.8/util/resetReplayIdOnDynamicSamplingContext.d.ts +14 -0
- package/build/npm/types-ts3.8/util/rrweb.d.ts +7 -0
- package/build/npm/types-ts3.8/util/sendReplay.d.ts +9 -0
- package/build/npm/types-ts3.8/util/sendReplayRequest.d.ts +27 -0
- package/build/npm/types-ts3.8/util/shouldFilterRequest.d.ts +7 -0
- package/build/npm/types-ts3.8/util/throttle.d.ts +12 -0
- package/build/npm/types-ts3.8/util/timestamp.d.ts +9 -0
- package/build/npm/types-ts3.8/worker-bundler.d.ts +2 -0
- package/package.json +99 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Functional Software, Inc. dba Sentry
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
9
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
10
|
+
so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,257 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
|
|
3
|
+
<img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Elenjical" width="280" height="84">
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
2
6
|
|
|
3
|
-
|
|
7
|
+
# Elenjical Session Replay
|
|
8
|
+
|
|
9
|
+
[](https://www.npmjs.com/package/@elenjical/replay)
|
|
10
|
+
[](https://www.npmjs.com/package/@elenjical/replay)
|
|
11
|
+
[](https://www.npmjs.com/package/@elenjical/replay)
|
|
12
|
+
|
|
13
|
+
> [!NOTE]
|
|
14
|
+
> This package is an internal library published for use by Elenjical-owned JavaScript SDK packages. It is re-exported from
|
|
15
|
+
> `@elenjical/browser` and other browser-related SDKs like `@elenjical/react` and `@elenjical/vue`. It is not part of the public
|
|
16
|
+
> API contract and may change in any release. Do not rely on SemVer compatibility if you depend on it directly.
|
|
17
|
+
|
|
18
|
+
## Pre-requisites
|
|
19
|
+
|
|
20
|
+
`@elenjical/replay` requires Node 14+, and browsers newer than IE11.
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
Replay can be imported from `@elenjical/browser`, or a respective SDK package like `@elenjical/react` or `@elenjical/vue`. You
|
|
25
|
+
don't need to install anything in order to use Session Replay. The minimum version that includes Replay is 7.27.0.
|
|
26
|
+
|
|
27
|
+
For details on using Replay when using Elenjical via the CDN bundles, see [CDN bundle](#loading-replay-as-a-cdn-bundle).
|
|
28
|
+
|
|
29
|
+
## Setup
|
|
30
|
+
|
|
31
|
+
To set up the integration, add the following to your Elenjical initialization. Several options are supported and passable
|
|
32
|
+
via the integration constructor. See the [configuration section](#configuration) below for more details.
|
|
33
|
+
|
|
34
|
+
```javascript
|
|
35
|
+
import * as Elenjical from '@elenjical/browser';
|
|
36
|
+
// or e.g. import * as Elenjical from '@elenjical/react';
|
|
37
|
+
|
|
38
|
+
Elenjical.init({
|
|
39
|
+
dsn: '__DSN__',
|
|
40
|
+
|
|
41
|
+
// This sets the sample rate to be 10%. You may want this to be 100% while
|
|
42
|
+
// in development and sample at a lower rate in production
|
|
43
|
+
replaysSessionSampleRate: 0.1,
|
|
44
|
+
|
|
45
|
+
// If the entire session is not sampled, use the below sample rate to sample
|
|
46
|
+
// sessions when an error occurs.
|
|
47
|
+
replaysOnErrorSampleRate: 1.0,
|
|
48
|
+
|
|
49
|
+
integrations: [
|
|
50
|
+
Elenjical.replayIntegration({
|
|
51
|
+
// Additional SDK configuration goes in here, for example:
|
|
52
|
+
maskAllText: true,
|
|
53
|
+
blockAllMedia: true,
|
|
54
|
+
// See below for all available options
|
|
55
|
+
}),
|
|
56
|
+
],
|
|
57
|
+
// ...
|
|
58
|
+
});
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Lazy loading Replay
|
|
62
|
+
|
|
63
|
+
Replay will start automatically when you add the integration. If you do not want to start Replay immediately (e.g. if
|
|
64
|
+
you want to lazy-load it), you can also use `addIntegration` to load it later:
|
|
65
|
+
|
|
66
|
+
```js
|
|
67
|
+
import * as Elenjical from "@elenjical/react";
|
|
68
|
+
import { BrowserClient } from "@elenjical/browser";
|
|
69
|
+
|
|
70
|
+
Elenjical.init({
|
|
71
|
+
// Do not load it initially
|
|
72
|
+
integrations: []
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
// Sometime later
|
|
76
|
+
const { Replay } = await import('@elenjical/browser');
|
|
77
|
+
const client = Elenjical.getClient<BrowserClient>();
|
|
78
|
+
|
|
79
|
+
// Client can be undefined
|
|
80
|
+
client?.addIntegration(Elenjical.replayIntegration());
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Identifying Users
|
|
84
|
+
|
|
85
|
+
If you have only followed the above instructions to setup session replays, you will only see IP addresses in Elenjical's
|
|
86
|
+
UI. In order to associate a user identity to a session replay, use
|
|
87
|
+
[`setUser`](https://docs.sentry.io/platforms/javascript/enriching-events/identify-user/).
|
|
88
|
+
|
|
89
|
+
```javascript
|
|
90
|
+
import * as Elenjical from '@elenjical/browser';
|
|
91
|
+
|
|
92
|
+
Elenjical.setUser({ email: 'jane.doe@example.com' });
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Stopping & starting Replays manually
|
|
96
|
+
|
|
97
|
+
Replay recording only starts when it is included in the `integrations` array when calling `Elenjical.init` or calling
|
|
98
|
+
`addIntegration` from the a Elenjical client instance. To stop recording you can call `stop()`.
|
|
99
|
+
|
|
100
|
+
```js
|
|
101
|
+
import * as Elenjical from "@elenjical/react";
|
|
102
|
+
import { BrowserClient } from "@elenjical/browser";
|
|
103
|
+
|
|
104
|
+
const replay = Elenjical.replayIntegration();
|
|
105
|
+
|
|
106
|
+
Elenjical.init({
|
|
107
|
+
integrations: [replay]
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
const client = Elenjical.getClient<BrowserClient>();
|
|
111
|
+
|
|
112
|
+
// Add replay integration, will start recording
|
|
113
|
+
client?.addIntegration(replay);
|
|
114
|
+
|
|
115
|
+
// Stop recording
|
|
116
|
+
replay.stop();
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
When both `replaysSessionSampleRate` and `replaysOnErrorSampleRate` are `0`, recording will _not_ start. In this case,
|
|
120
|
+
you can manually start recording:
|
|
121
|
+
|
|
122
|
+
```js
|
|
123
|
+
replay.start(); // Will start a session in "session" mode, regardless of sample rates
|
|
124
|
+
replay.startBuffering(); // Will start a session in "buffer" mode, regardless of sample rates
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Loading Replay as a CDN Bundle
|
|
128
|
+
|
|
129
|
+
As an alternative to the NPM package, you can use Replay as a CDN bundle. Please refer to the
|
|
130
|
+
[Session Replay installation guide](https://docs.sentry.io/platforms/javascript/session-replay/#install) for CDN bundle
|
|
131
|
+
instructions.
|
|
132
|
+
|
|
133
|
+
<details>
|
|
134
|
+
<summary>Deprecated Replay integration bundle</summary>
|
|
135
|
+
Installing the replay integration as a secondary integration bundle to the SDK bundle was deprecated in favour of
|
|
136
|
+
complete CDN bundles that already contain the replay integration. No need to keep two bundles in sync anymore.
|
|
137
|
+
The `replay.(min.)js` bundle will be removed in v8 of the JS SDKs.
|
|
138
|
+
|
|
139
|
+
```html
|
|
140
|
+
<script src="https://browser.sentry-cdn.com/7.41.0/bundle.min.js" crossorigin="anonymous"></script>
|
|
141
|
+
<script src="https://browser.sentry-cdn.com/7.41.0/replay.min.js" crossorigin="anonymous"></script>
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
</details>
|
|
145
|
+
|
|
146
|
+
## Sessions
|
|
147
|
+
|
|
148
|
+
A session starts when the Session Replay SDK is first loaded and initialized. The session will continue until 5 minutes
|
|
149
|
+
passes without any user interactions[^1] with the application _OR_ until a maximum of 30 minutes have elapsed. Closing
|
|
150
|
+
the browser tab will end the session immediately according to the rules for
|
|
151
|
+
[SessionStorage](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage).
|
|
152
|
+
|
|
153
|
+
[^1]: An 'interaction' refers to either a mouse click or a browser navigation event.
|
|
154
|
+
|
|
155
|
+
### Accessing the Replay Session ID
|
|
156
|
+
|
|
157
|
+
You can get the ID of the currently running session via `replay.getReplayId()`. This will return `undefined` if no
|
|
158
|
+
session is ongoing.
|
|
159
|
+
|
|
160
|
+
### Replay Captures Only on Errors
|
|
161
|
+
|
|
162
|
+
Alternatively, rather than recording an entire session, you can capture a replay only when an error occurs. In this
|
|
163
|
+
case, the integration will buffer up to one minute worth of events prior to the error being thrown. It will continue to
|
|
164
|
+
record the session following the rules above regarding session life and activity. Read the [sampling](#Sampling) section
|
|
165
|
+
for configuration options.
|
|
166
|
+
|
|
167
|
+
## Sampling
|
|
168
|
+
|
|
169
|
+
Sampling allows you to control how much of your website's traffic will result in a Session Replay. There are two sample
|
|
170
|
+
rates you can adjust to get the replays more relevant to your interests:
|
|
171
|
+
|
|
172
|
+
- `replaysSessionSampleRate` - The sample rate for replays that begin recording immediately and last the entirety of the
|
|
173
|
+
user's session.
|
|
174
|
+
- `replaysOnErrorSampleRate` - The sample rate for replays that are recorded when an error happens. This type of replay
|
|
175
|
+
will record up to a minute of events prior to the error and continue recording until the session ends.
|
|
176
|
+
|
|
177
|
+
When Replay is initialized, we check the `replaysSessionSampleRate`. If it is sampled, then we start recording & sending
|
|
178
|
+
Replay data immediately. Else, if `replaysOnErrorSampleRate > 0`, we'll start recording in buffering mode. In this mode,
|
|
179
|
+
whenever an error occurs we'll check `replaysOnErrorSampleRate`. If it is sampled, when we'll upload the Replay to
|
|
180
|
+
Elenjical and continue recording normally.
|
|
181
|
+
|
|
182
|
+
## Configuration
|
|
183
|
+
|
|
184
|
+
### SDK Configuration
|
|
185
|
+
|
|
186
|
+
The following options can be configured on the root level of your browser-based Elenjical SDK, in `init({})`:
|
|
187
|
+
|
|
188
|
+
| key | type | default | description |
|
|
189
|
+
| ------------------------ | ------ | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
190
|
+
| 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. |
|
|
191
|
+
| 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. |
|
|
192
|
+
|
|
193
|
+
### General Integration Configuration
|
|
194
|
+
|
|
195
|
+
The following options can be configured as options to the integration, in `Elenjical.replayIntegration({})`:
|
|
196
|
+
|
|
197
|
+
| key | type | default | description |
|
|
198
|
+
| ------------- | ------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
199
|
+
| 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. |
|
|
200
|
+
|
|
201
|
+
### Privacy Configuration
|
|
202
|
+
|
|
203
|
+
The following options can be configured as options to the integration, in `Elenjical.replayIntegration({})`:
|
|
204
|
+
|
|
205
|
+
| key | type | default | description |
|
|
206
|
+
| ------------- | ------------------------ | -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
207
|
+
| maskAllText | boolean | `true` | Mask _all_ text content. Will pass text content through `maskFn` before sending to server. |
|
|
208
|
+
| maskAllInputs | boolean | `true` | Mask values of `<input>` elements. Passes input values through `maskInputFn` before sending to server. |
|
|
209
|
+
| blockAllMedia | boolean | `true` | Block _all_ media elements (`img, svg, video, object, picture, embed, map, audio`) |
|
|
210
|
+
| 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 `*`. |
|
|
211
|
+
| block | Array<string> | `.sentry-block, [data-sentry-block]` | Redact any elements that match the DOM selectors. See [privacy](#blocking) section for an example. |
|
|
212
|
+
| unblock | Array<string> | [] | Do not redact any elements that match the DOM selectors. Useful when using `blockAllMedia`. See [privacy](#blocking) section for an example. |
|
|
213
|
+
| mask | Array<string> | `.sentry-mask, [data-sentry-mask]` | Mask all elements that match the given DOM selectors. See [privacy](#masking) section for an example. |
|
|
214
|
+
| unmask | Array<string> | [] | Unmask all elements that match the given DOM selectors. Useful when using `maskAllText`. See [privacy](#masking) section for an example. |
|
|
215
|
+
| ignore | Array<string> | `.sentry-ignore, [data-sentry-ignore]` | Ignores all events on the matching input fields. See [privacy](#ignoring) section for an example. |
|
|
216
|
+
|
|
217
|
+
## Privacy
|
|
218
|
+
|
|
219
|
+
There are several ways to deal with PII. By default, the integration will mask all text content with `*` and block all
|
|
220
|
+
media elements (`img, svg, video, object, picture, embed, map, audio`). This can be disabled by setting `maskAllText` to
|
|
221
|
+
`false`. It is also possible to add the following CSS classes to specific DOM elements to prevent recording its
|
|
222
|
+
contents: `sentry-block`, `sentry-ignore`, and `sentry-mask`. The following sections will show examples of how content
|
|
223
|
+
is handled by the differing methods.
|
|
224
|
+
|
|
225
|
+
### Masking
|
|
226
|
+
|
|
227
|
+
Masking replaces the text content with something else. The default masking behavior is to replace each character with a
|
|
228
|
+
`*`. In this example the relevant html code is: `<table class="sentry-mask">...</table>`.
|
|
229
|
+

|
|
230
|
+
|
|
231
|
+
### Blocking
|
|
232
|
+
|
|
233
|
+
Blocking replaces the element with a placeholder that has the same dimensions. The recording will show an empty space
|
|
234
|
+
where the content was. In this example the relevant html code is: `<table data-sentry-block>...</table>`.
|
|
235
|
+

|
|
236
|
+
|
|
237
|
+
### Ignoring
|
|
238
|
+
|
|
239
|
+
Ignoring only applies to form inputs. Events will be ignored on the input element so that the replay does not show what
|
|
240
|
+
occurs inside of the input. In the below example, notice how the results in the table below the input changes, but no
|
|
241
|
+
text is visible in the input.
|
|
242
|
+
|
|
243
|
+
https://user-images.githubusercontent.com/79684/192815134-a6451c3f-d3cb-455f-a699-7c3fe04d0a2e.mov
|
|
244
|
+
|
|
245
|
+
## Error Linking
|
|
246
|
+
|
|
247
|
+
Currently, errors that happen on the page while a replay is running are linked to the Replay, making it as easy as
|
|
248
|
+
possible to jump between related issues/replays. However, please note that it is _possible_ that the error count
|
|
249
|
+
reported on the Replay Detail page does not match the actual errors that have been captured. The reason for that is that
|
|
250
|
+
errors _can_ be lost, e.g. a network request fails, or similar. This should not happen to often, but be aware that it is
|
|
251
|
+
theoretically possible.
|
|
252
|
+
|
|
253
|
+
## Manually sending replay data
|
|
254
|
+
|
|
255
|
+
You can use `replay.flush()` to immediately send all currently captured replay data. When Replay is currently in
|
|
256
|
+
buffering mode, this will send up to the last 60 seconds of replay data, and also continue sending afterwards, similar
|
|
257
|
+
to when an error happens & is recorded.
|