@sentry/replay 0.4.8-3 → 0.4.8
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/README.md +15 -15
- package/dist/config/dist/src/api/captureReplay.d.ts +5 -3
- package/dist/config/dist/src/api/captureReplayUpdate.d.ts +5 -3
- package/dist/config/dist/src/coreHandlers/getBreadcrumbHandler.d.ts +3 -0
- package/dist/config/dist/src/coreHandlers/getSpanHandler.d.ts +5 -0
- package/dist/config/dist/src/coreHandlers/handleFetch.d.ts +19 -2
- package/dist/config/dist/src/coreHandlers/handleHistory.d.ts +7 -0
- package/dist/config/dist/src/coreHandlers/handleXhr.d.ts +21 -2
- package/dist/config/dist/src/index.d.ts +18 -7
- package/dist/config/dist/src/types.d.ts +20 -8
- package/dist/config/dist/src/util/createPayload.d.ts +5 -0
- package/dist/dist/api/captureReplay.d.ts +5 -3
- package/dist/dist/api/captureReplayUpdate.d.ts +5 -3
- package/dist/dist/coreHandlers/getBreadcrumbHandler.d.ts +3 -0
- package/dist/dist/coreHandlers/getSpanHandler.d.ts +5 -0
- package/dist/dist/coreHandlers/handleFetch.d.ts +19 -2
- package/dist/dist/coreHandlers/handleHistory.d.ts +7 -0
- package/dist/dist/coreHandlers/handleXhr.d.ts +21 -2
- package/dist/dist/index.d.ts +18 -7
- package/dist/dist/types.d.ts +20 -8
- package/dist/index.es.js +219 -122
- package/dist/index.js +218 -121
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/dist/coreHandlers/index.d.ts +0 -4
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ This integration is a WIP.
|
|
|
4
4
|
|
|
5
5
|
## Pre-Requisites
|
|
6
6
|
|
|
7
|
-
For the sentry-replay integration to work, you must have the [Sentry browser SDK package](https://www.npmjs.com/package/@sentry/browser)
|
|
7
|
+
For the sentry-replay integration to work, you must have the [Sentry browser SDK package](https://www.npmjs.com/package/@sentry/browser) installed.
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
@@ -19,13 +19,13 @@ npm install --save @sentry/browser @sentry/replay
|
|
|
19
19
|
with yarn:
|
|
20
20
|
|
|
21
21
|
```shell
|
|
22
|
-
yarn add @sentry/
|
|
22
|
+
yarn add @sentry/browser @sentry/replay
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
## Setup
|
|
26
26
|
|
|
27
|
-
To set up the integration add the following to your Sentry initialization. Several options are supported and passable via the integration constructor.
|
|
28
|
-
See the rrweb documentation for advice on configuring these values.
|
|
27
|
+
To set up the integration add the following to your Sentry initialization. Several options are supported and passable via the integration constructor.
|
|
28
|
+
See the rrweb documentation for advice on configuring these values.
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
```javascript
|
|
@@ -51,14 +51,14 @@ Sentry.init({
|
|
|
51
51
|
|
|
52
52
|
| key | type | default | description |
|
|
53
53
|
| --- | ---- | ------- | ----------- |
|
|
54
|
-
| flushMinDelay | number | 5000 | The minimum time to wait (in ms) before sending the recording payload. The payload is sent if `flushMinDelay` ms have elapsed between two events. |
|
|
55
|
-
| flushMaxDelay | number | 15000 | The maximum time to wait (in ms) when sending the recording payload. The payload is sent if events occur at an interval less than `flushMinDelay` and `flushMaxDelay` ms have elapsed since the last time a payload was sent. |
|
|
56
|
-
| initialFlushDelay | number | 5000 | The amount of time to wait (in ms) before sending the initial recording payload. This helps drop recordings where users visit and close the page quickly. |
|
|
57
|
-
| stickySession | boolean | false | 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. |
|
|
58
|
-
| useCompression | boolean | true | Uses `WebWorkers` (if available) to compress the recording payload before uploading to Sentry. |
|
|
59
|
-
| captureOnlyOnError | boolean | false | Only capture the recording when an error happens. |
|
|
60
|
-
| replaysSamplingRate | number | 1.0 | The rate at which to sample replays. (1.0 will collect all replays, 0 will collect no replays). |
|
|
61
|
-
| maskAllInputs | boolean | true | Mask all `<input>` elements |
|
|
62
|
-
| blockClass | string | `'sr-block'` | Redact all elements with the class name `sr-block` |
|
|
63
|
-
| ignoreClass | string | `'sr-ignore'` | Ignores all elements with the class name `sr-ignore` |
|
|
64
|
-
| maskTextClass | string | `'sr-mask'` | Mask all elements with the class name `sr-ignore` |
|
|
54
|
+
| `flushMinDelay` | `number` | `5000` | The minimum time to wait (in ms) before sending the recording payload. The payload is sent if `flushMinDelay` ms have elapsed between two events. |
|
|
55
|
+
| `flushMaxDelay` | `number` | `15000` | The maximum time to wait (in ms) when sending the recording payload. The payload is sent if events occur at an interval less than `flushMinDelay` and `flushMaxDelay` ms have elapsed since the last time a payload was sent. |
|
|
56
|
+
| `initialFlushDelay` | `number` | `5000` | The amount of time to wait (in ms) before sending the initial recording payload. This helps drop recordings where users visit and close the page quickly. |
|
|
57
|
+
| `stickySession` | `boolean` | `false` | 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. |
|
|
58
|
+
| `useCompression` | `boolean` | `true` | Uses `WebWorkers` (if available) to compress the recording payload before uploading to Sentry. |
|
|
59
|
+
| `captureOnlyOnError` | `boolean` | `false` | Only capture the recording when an error happens. |
|
|
60
|
+
| `replaysSamplingRate` | `number` | `1.0` | The rate at which to sample replays. (1.0 will collect all replays, 0 will collect no replays). |
|
|
61
|
+
| `recordingConfig.maskAllInputs` | `boolean` | `true` | Mask all `<input>` elements |
|
|
62
|
+
| `recordingConfig.blockClass` | `string` | `'sr-block'` | Redact all elements with the class name `sr-block` |
|
|
63
|
+
| `recordingConfig.ignoreClass` | `string` | `'sr-ignore'` | Ignores all elements with the class name `sr-ignore` |
|
|
64
|
+
| `recordingConfig.maskTextClass` | `string` | `'sr-mask'` | Mask all elements with the class name `sr-ignore` |
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { Session } from '@/session/Session';
|
|
2
2
|
import { InitialState } from '@/types';
|
|
3
|
-
interface CaptureReplayParams {
|
|
3
|
+
export interface CaptureReplayParams {
|
|
4
4
|
session: Session;
|
|
5
5
|
initialState: InitialState;
|
|
6
|
+
errorIds: string[];
|
|
7
|
+
traceIds: string[];
|
|
8
|
+
urls: string[];
|
|
6
9
|
}
|
|
7
|
-
export declare function captureReplay({ session, initialState }: CaptureReplayParams): void;
|
|
8
|
-
export {};
|
|
10
|
+
export declare function captureReplay({ session, initialState, errorIds, traceIds, urls, }: CaptureReplayParams): void;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { Session } from '@/session/Session';
|
|
2
|
-
interface CaptureReplayUpdateParams {
|
|
2
|
+
export interface CaptureReplayUpdateParams {
|
|
3
3
|
session: Session;
|
|
4
4
|
/**
|
|
5
5
|
* Timestamp of the event in milliseconds
|
|
6
6
|
*/
|
|
7
7
|
timestamp: number;
|
|
8
|
+
errorIds: string[];
|
|
9
|
+
traceIds: string[];
|
|
10
|
+
urls: string[];
|
|
8
11
|
}
|
|
9
|
-
export declare function captureReplayUpdate({ session, timestamp, }: CaptureReplayUpdateParams): void;
|
|
10
|
-
export {};
|
|
12
|
+
export declare function captureReplayUpdate({ session, timestamp, errorIds, traceIds, urls, }: CaptureReplayUpdateParams): void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { InstrumentationTypeSpan } from '@/types';
|
|
2
|
+
import { handleFetch } from './handleFetch';
|
|
3
|
+
import { handleHistory } from './handleHistory';
|
|
4
|
+
import { handleXhr } from './handleXhr';
|
|
5
|
+
export declare function getSpanHandler(type: InstrumentationTypeSpan): typeof handleFetch | typeof handleXhr | typeof handleHistory;
|
|
@@ -1,2 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ReplayPerformanceEntry } from '@/createPerformanceEntry';
|
|
2
|
+
interface FetchHandlerData {
|
|
3
|
+
args: Parameters<typeof fetch>;
|
|
4
|
+
fetchData: {
|
|
5
|
+
method: string;
|
|
6
|
+
url: string;
|
|
7
|
+
};
|
|
8
|
+
response: {
|
|
9
|
+
type: string;
|
|
10
|
+
url: string;
|
|
11
|
+
redirected: boolean;
|
|
12
|
+
status: number;
|
|
13
|
+
ok: boolean;
|
|
14
|
+
};
|
|
15
|
+
startTimestamp: number;
|
|
16
|
+
endTimestamp?: number;
|
|
17
|
+
}
|
|
18
|
+
export declare function handleFetch(handlerData: FetchHandlerData): ReplayPerformanceEntry;
|
|
19
|
+
export {};
|
|
@@ -1,2 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ReplayPerformanceEntry } from '@/createPerformanceEntry';
|
|
2
|
+
declare type XHRSendInput = null | Blob | BufferSource | FormData | URLSearchParams | string;
|
|
3
|
+
interface SentryWrappedXMLHttpRequest extends XMLHttpRequest {
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
__sentry_xhr__?: {
|
|
6
|
+
method?: string;
|
|
7
|
+
url?: string;
|
|
8
|
+
status_code?: number;
|
|
9
|
+
body?: XHRSendInput;
|
|
10
|
+
startTimestamp?: number;
|
|
11
|
+
};
|
|
12
|
+
__sentry_own_request__?: boolean;
|
|
13
|
+
}
|
|
14
|
+
interface XhrHandlerData {
|
|
15
|
+
args: [method: string, url: string];
|
|
16
|
+
xhr: SentryWrappedXMLHttpRequest;
|
|
17
|
+
startTimestamp: number;
|
|
18
|
+
endTimestamp?: number;
|
|
19
|
+
}
|
|
20
|
+
export declare function handleXhr(handlerData: XhrHandlerData): ReplayPerformanceEntry;
|
|
21
|
+
export {};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Breadcrumb, DsnComponents, Event, Integration } from '@sentry/types';
|
|
2
|
+
import { CaptureReplayParams } from './api/captureReplay';
|
|
3
|
+
import { CaptureReplayUpdateParams } from './api/captureReplayUpdate';
|
|
2
4
|
import { Session } from './session/Session';
|
|
3
5
|
import { ReplayPerformanceEntry } from './createPerformanceEntry';
|
|
4
6
|
import { IEventBuffer } from './eventBuffer';
|
|
5
|
-
import type {
|
|
7
|
+
import type { InstrumentationTypeBreadcrumb, InstrumentationTypeSpan, RecordingConfig, RecordingEvent, ReplayRequest, SentryReplayConfiguration, SentryReplayPluginOptions } from './types';
|
|
6
8
|
/**
|
|
7
9
|
* Returns true to return control to calling function, otherwise continue with normal batching
|
|
8
10
|
*/
|
|
@@ -21,10 +23,6 @@ export declare class SentryReplay implements Integration {
|
|
|
21
23
|
* Buffer of breadcrumbs to be uploaded
|
|
22
24
|
*/
|
|
23
25
|
breadcrumbs: Breadcrumb[];
|
|
24
|
-
/**
|
|
25
|
-
* Buffer of replay spans to be uploaded
|
|
26
|
-
*/
|
|
27
|
-
replaySpans: ReplaySpan[];
|
|
28
26
|
/**
|
|
29
27
|
* List of PerformanceEntry from PerformanceObserver
|
|
30
28
|
*/
|
|
@@ -58,6 +56,7 @@ export declare class SentryReplay implements Integration {
|
|
|
58
56
|
* Captured state when integration is first initialized
|
|
59
57
|
*/
|
|
60
58
|
private initialState;
|
|
59
|
+
private context;
|
|
61
60
|
session: Session | undefined;
|
|
62
61
|
static attachmentUrlFromDsn(dsn: DsnComponents, eventId: string): string;
|
|
63
62
|
constructor({ flushMinDelay, flushMaxDelay, initialFlushDelay, stickySession, // TBD: Making this opt-in for now
|
|
@@ -141,10 +140,16 @@ export declare class SentryReplay implements Integration {
|
|
|
141
140
|
/**
|
|
142
141
|
* Handler for Sentry Core SDK events.
|
|
143
142
|
*
|
|
144
|
-
*
|
|
143
|
+
* These specific events will create span-like objects in the recording.
|
|
144
|
+
*
|
|
145
|
+
*/
|
|
146
|
+
handleCoreSpanListener: (type: InstrumentationTypeSpan) => (handlerData: any) => void;
|
|
147
|
+
/**
|
|
148
|
+
* Handler for Sentry Core SDK events.
|
|
145
149
|
*
|
|
150
|
+
* These events will create breadcrumb-like objects in the recording.
|
|
146
151
|
*/
|
|
147
|
-
|
|
152
|
+
handleCoreBreadcrumbListener: (type: InstrumentationTypeBreadcrumb) => (handlerData: any) => void;
|
|
148
153
|
/**
|
|
149
154
|
* Keep a list of performance entries that will be sent with a replay
|
|
150
155
|
*/
|
|
@@ -189,6 +194,12 @@ export declare class SentryReplay implements Integration {
|
|
|
189
194
|
* Only flush if `captureOnlyOnError` is false.
|
|
190
195
|
*/
|
|
191
196
|
conditionalFlush(lastActivity?: number): Promise<void>;
|
|
197
|
+
/**
|
|
198
|
+
* Return and clear context
|
|
199
|
+
*/
|
|
200
|
+
popEventContext({ timestamp, }: {
|
|
201
|
+
timestamp: number;
|
|
202
|
+
}): CaptureReplayParams & CaptureReplayUpdateParams;
|
|
192
203
|
/**
|
|
193
204
|
* Flushes replay event buffer to Sentry.
|
|
194
205
|
*
|
|
@@ -2,18 +2,13 @@ import { record } from 'rrweb';
|
|
|
2
2
|
import type { eventWithTime } from 'rrweb/typings/types';
|
|
3
3
|
export declare type RecordingEvent = eventWithTime;
|
|
4
4
|
export declare type RecordingConfig = Parameters<typeof record>[0];
|
|
5
|
-
export interface ReplaySpan {
|
|
6
|
-
description: string;
|
|
7
|
-
op: string;
|
|
8
|
-
startTimestamp: number;
|
|
9
|
-
endTimestamp: number;
|
|
10
|
-
data?: Record<string, unknown>;
|
|
11
|
-
}
|
|
12
5
|
export interface ReplayRequest {
|
|
13
6
|
endpoint: string;
|
|
14
7
|
events: Uint8Array | string;
|
|
15
8
|
}
|
|
16
|
-
export declare type
|
|
9
|
+
export declare type InstrumentationTypeBreadcrumb = 'dom' | 'scope';
|
|
10
|
+
export declare type InstrumentationTypeSpan = 'fetch' | 'xhr' | 'history';
|
|
11
|
+
export declare type InstrumentationType = InstrumentationTypeBreadcrumb | InstrumentationTypeSpan | 'console' | 'error' | 'unhandledrejection';
|
|
17
12
|
/**
|
|
18
13
|
* The request payload to worker
|
|
19
14
|
*/
|
|
@@ -76,3 +71,20 @@ export interface InitialState {
|
|
|
76
71
|
timestamp: number;
|
|
77
72
|
url: string;
|
|
78
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Additional context that will be sent w/ `replay_event`
|
|
76
|
+
*/
|
|
77
|
+
export interface ReplayEventContext {
|
|
78
|
+
/**
|
|
79
|
+
* Set of Sentry error ids that have occurred during a replay segment
|
|
80
|
+
*/
|
|
81
|
+
errorIds: Set<string>;
|
|
82
|
+
/**
|
|
83
|
+
* Set of Sentry trace ids that have occurred during a replay segment
|
|
84
|
+
*/
|
|
85
|
+
traceIds: Set<string>;
|
|
86
|
+
/**
|
|
87
|
+
* Ordered list of URLs that have been visited during a replay segment
|
|
88
|
+
*/
|
|
89
|
+
urls: string[];
|
|
90
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { Session } from '@/session/Session';
|
|
2
2
|
import { InitialState } from '@/types';
|
|
3
|
-
interface CaptureReplayParams {
|
|
3
|
+
export interface CaptureReplayParams {
|
|
4
4
|
session: Session;
|
|
5
5
|
initialState: InitialState;
|
|
6
|
+
errorIds: string[];
|
|
7
|
+
traceIds: string[];
|
|
8
|
+
urls: string[];
|
|
6
9
|
}
|
|
7
|
-
export declare function captureReplay({ session, initialState }: CaptureReplayParams): void;
|
|
8
|
-
export {};
|
|
10
|
+
export declare function captureReplay({ session, initialState, errorIds, traceIds, urls, }: CaptureReplayParams): void;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { Session } from '@/session/Session';
|
|
2
|
-
interface CaptureReplayUpdateParams {
|
|
2
|
+
export interface CaptureReplayUpdateParams {
|
|
3
3
|
session: Session;
|
|
4
4
|
/**
|
|
5
5
|
* Timestamp of the event in milliseconds
|
|
6
6
|
*/
|
|
7
7
|
timestamp: number;
|
|
8
|
+
errorIds: string[];
|
|
9
|
+
traceIds: string[];
|
|
10
|
+
urls: string[];
|
|
8
11
|
}
|
|
9
|
-
export declare function captureReplayUpdate({ session, timestamp, }: CaptureReplayUpdateParams): void;
|
|
10
|
-
export {};
|
|
12
|
+
export declare function captureReplayUpdate({ session, timestamp, errorIds, traceIds, urls, }: CaptureReplayUpdateParams): void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { InstrumentationTypeSpan } from '@/types';
|
|
2
|
+
import { handleFetch } from './handleFetch';
|
|
3
|
+
import { handleHistory } from './handleHistory';
|
|
4
|
+
import { handleXhr } from './handleXhr';
|
|
5
|
+
export declare function getSpanHandler(type: InstrumentationTypeSpan): typeof handleFetch | typeof handleXhr | typeof handleHistory;
|
|
@@ -1,2 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ReplayPerformanceEntry } from '@/createPerformanceEntry';
|
|
2
|
+
interface FetchHandlerData {
|
|
3
|
+
args: Parameters<typeof fetch>;
|
|
4
|
+
fetchData: {
|
|
5
|
+
method: string;
|
|
6
|
+
url: string;
|
|
7
|
+
};
|
|
8
|
+
response: {
|
|
9
|
+
type: string;
|
|
10
|
+
url: string;
|
|
11
|
+
redirected: boolean;
|
|
12
|
+
status: number;
|
|
13
|
+
ok: boolean;
|
|
14
|
+
};
|
|
15
|
+
startTimestamp: number;
|
|
16
|
+
endTimestamp?: number;
|
|
17
|
+
}
|
|
18
|
+
export declare function handleFetch(handlerData: FetchHandlerData): ReplayPerformanceEntry;
|
|
19
|
+
export {};
|
|
@@ -1,2 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ReplayPerformanceEntry } from '@/createPerformanceEntry';
|
|
2
|
+
declare type XHRSendInput = null | Blob | BufferSource | FormData | URLSearchParams | string;
|
|
3
|
+
interface SentryWrappedXMLHttpRequest extends XMLHttpRequest {
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
__sentry_xhr__?: {
|
|
6
|
+
method?: string;
|
|
7
|
+
url?: string;
|
|
8
|
+
status_code?: number;
|
|
9
|
+
body?: XHRSendInput;
|
|
10
|
+
startTimestamp?: number;
|
|
11
|
+
};
|
|
12
|
+
__sentry_own_request__?: boolean;
|
|
13
|
+
}
|
|
14
|
+
interface XhrHandlerData {
|
|
15
|
+
args: [method: string, url: string];
|
|
16
|
+
xhr: SentryWrappedXMLHttpRequest;
|
|
17
|
+
startTimestamp: number;
|
|
18
|
+
endTimestamp?: number;
|
|
19
|
+
}
|
|
20
|
+
export declare function handleXhr(handlerData: XhrHandlerData): ReplayPerformanceEntry;
|
|
21
|
+
export {};
|
package/dist/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Breadcrumb, DsnComponents, Event, Integration } from '@sentry/types';
|
|
2
|
+
import { CaptureReplayParams } from './api/captureReplay';
|
|
3
|
+
import { CaptureReplayUpdateParams } from './api/captureReplayUpdate';
|
|
2
4
|
import { Session } from './session/Session';
|
|
3
5
|
import { ReplayPerformanceEntry } from './createPerformanceEntry';
|
|
4
6
|
import { IEventBuffer } from './eventBuffer';
|
|
5
|
-
import type {
|
|
7
|
+
import type { InstrumentationTypeBreadcrumb, InstrumentationTypeSpan, RecordingConfig, RecordingEvent, ReplayRequest, SentryReplayConfiguration, SentryReplayPluginOptions } from './types';
|
|
6
8
|
/**
|
|
7
9
|
* Returns true to return control to calling function, otherwise continue with normal batching
|
|
8
10
|
*/
|
|
@@ -21,10 +23,6 @@ export declare class SentryReplay implements Integration {
|
|
|
21
23
|
* Buffer of breadcrumbs to be uploaded
|
|
22
24
|
*/
|
|
23
25
|
breadcrumbs: Breadcrumb[];
|
|
24
|
-
/**
|
|
25
|
-
* Buffer of replay spans to be uploaded
|
|
26
|
-
*/
|
|
27
|
-
replaySpans: ReplaySpan[];
|
|
28
26
|
/**
|
|
29
27
|
* List of PerformanceEntry from PerformanceObserver
|
|
30
28
|
*/
|
|
@@ -58,6 +56,7 @@ export declare class SentryReplay implements Integration {
|
|
|
58
56
|
* Captured state when integration is first initialized
|
|
59
57
|
*/
|
|
60
58
|
private initialState;
|
|
59
|
+
private context;
|
|
61
60
|
session: Session | undefined;
|
|
62
61
|
static attachmentUrlFromDsn(dsn: DsnComponents, eventId: string): string;
|
|
63
62
|
constructor({ flushMinDelay, flushMaxDelay, initialFlushDelay, stickySession, // TBD: Making this opt-in for now
|
|
@@ -141,10 +140,16 @@ export declare class SentryReplay implements Integration {
|
|
|
141
140
|
/**
|
|
142
141
|
* Handler for Sentry Core SDK events.
|
|
143
142
|
*
|
|
144
|
-
*
|
|
143
|
+
* These specific events will create span-like objects in the recording.
|
|
144
|
+
*
|
|
145
|
+
*/
|
|
146
|
+
handleCoreSpanListener: (type: InstrumentationTypeSpan) => (handlerData: any) => void;
|
|
147
|
+
/**
|
|
148
|
+
* Handler for Sentry Core SDK events.
|
|
145
149
|
*
|
|
150
|
+
* These events will create breadcrumb-like objects in the recording.
|
|
146
151
|
*/
|
|
147
|
-
|
|
152
|
+
handleCoreBreadcrumbListener: (type: InstrumentationTypeBreadcrumb) => (handlerData: any) => void;
|
|
148
153
|
/**
|
|
149
154
|
* Keep a list of performance entries that will be sent with a replay
|
|
150
155
|
*/
|
|
@@ -189,6 +194,12 @@ export declare class SentryReplay implements Integration {
|
|
|
189
194
|
* Only flush if `captureOnlyOnError` is false.
|
|
190
195
|
*/
|
|
191
196
|
conditionalFlush(lastActivity?: number): Promise<void>;
|
|
197
|
+
/**
|
|
198
|
+
* Return and clear context
|
|
199
|
+
*/
|
|
200
|
+
popEventContext({ timestamp, }: {
|
|
201
|
+
timestamp: number;
|
|
202
|
+
}): CaptureReplayParams & CaptureReplayUpdateParams;
|
|
192
203
|
/**
|
|
193
204
|
* Flushes replay event buffer to Sentry.
|
|
194
205
|
*
|
package/dist/dist/types.d.ts
CHANGED
|
@@ -2,18 +2,13 @@ import { record } from 'rrweb';
|
|
|
2
2
|
import type { eventWithTime } from 'rrweb/typings/types';
|
|
3
3
|
export declare type RecordingEvent = eventWithTime;
|
|
4
4
|
export declare type RecordingConfig = Parameters<typeof record>[0];
|
|
5
|
-
export interface ReplaySpan {
|
|
6
|
-
description: string;
|
|
7
|
-
op: string;
|
|
8
|
-
startTimestamp: number;
|
|
9
|
-
endTimestamp: number;
|
|
10
|
-
data?: Record<string, unknown>;
|
|
11
|
-
}
|
|
12
5
|
export interface ReplayRequest {
|
|
13
6
|
endpoint: string;
|
|
14
7
|
events: Uint8Array | string;
|
|
15
8
|
}
|
|
16
|
-
export declare type
|
|
9
|
+
export declare type InstrumentationTypeBreadcrumb = 'dom' | 'scope';
|
|
10
|
+
export declare type InstrumentationTypeSpan = 'fetch' | 'xhr' | 'history';
|
|
11
|
+
export declare type InstrumentationType = InstrumentationTypeBreadcrumb | InstrumentationTypeSpan | 'console' | 'error' | 'unhandledrejection';
|
|
17
12
|
/**
|
|
18
13
|
* The request payload to worker
|
|
19
14
|
*/
|
|
@@ -76,3 +71,20 @@ export interface InitialState {
|
|
|
76
71
|
timestamp: number;
|
|
77
72
|
url: string;
|
|
78
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Additional context that will be sent w/ `replay_event`
|
|
76
|
+
*/
|
|
77
|
+
export interface ReplayEventContext {
|
|
78
|
+
/**
|
|
79
|
+
* Set of Sentry error ids that have occurred during a replay segment
|
|
80
|
+
*/
|
|
81
|
+
errorIds: Set<string>;
|
|
82
|
+
/**
|
|
83
|
+
* Set of Sentry trace ids that have occurred during a replay segment
|
|
84
|
+
*/
|
|
85
|
+
traceIds: Set<string>;
|
|
86
|
+
/**
|
|
87
|
+
* Ordered list of URLs that have been visited during a replay segment
|
|
88
|
+
*/
|
|
89
|
+
urls: string[];
|
|
90
|
+
}
|