@sentry/replay
Advanced tools
Comparing version 0.6.10 to 0.6.11-0
@@ -43,3 +43,2 @@ import { Breadcrumb, Event, Integration } from '@sentry/types'; | ||
/** | ||
* | ||
* Paused is a state where: | ||
@@ -51,2 +50,7 @@ * - DOM Recording is not listening at all | ||
/** | ||
* Integration will wait until an error occurs before creating and sending a | ||
* replay. | ||
*/ | ||
private waitForError; | ||
/** | ||
* Have we attached listeners to the core SDK? | ||
@@ -66,3 +70,3 @@ * Note we have to track this as there is no way to remove instrumentation handlers. | ||
session: Session | undefined; | ||
constructor({ flushMinDelay, flushMaxDelay, initialFlushDelay, stickySession, useCompression, captureOnlyOnError, replaysSamplingRate, maskAllText, maskAllInputs, blockAllMedia, blockClass, ignoreClass, maskTextClass, blockSelector, ...recordingOptions }?: ReplayConfiguration); | ||
constructor({ flushMinDelay, flushMaxDelay, initialFlushDelay, stickySession, useCompression, sessionSampleRate, errorSampleRate, maskAllText, maskAllInputs, blockAllMedia, blockClass, ignoreClass, maskTextClass, blockSelector, replaysSamplingRate, captureOnlyOnError, ...recordingOptions }?: ReplayConfiguration); | ||
/** | ||
@@ -240,3 +244,3 @@ * Because we create a transaction in `setupOnce`, we can potentially create a | ||
/** | ||
* Only flush if `captureOnlyOnError` is false. | ||
* Only flush if `this.waitForError` is false. | ||
*/ | ||
@@ -277,3 +281,3 @@ conditionalFlush(): void; | ||
*/ | ||
flushImmediate(): void; | ||
flushImmediate(): any; | ||
/** | ||
@@ -280,0 +284,0 @@ * Send replay attachment using `fetch()` |
@@ -7,1 +7,6 @@ export declare const REPLAY_SESSION_KEY = "sentryReplaySession"; | ||
export declare const MAX_SESSION_LIFE = 1800000; | ||
/** | ||
* Defaults for sampling rates | ||
*/ | ||
export declare const DEFAULT_SESSION_SAMPLE_RATE = 0.1; | ||
export declare const DEFAULT_ERROR_SAMPLE_RATE = 1; |
@@ -0,13 +1,3 @@ | ||
import { SessionOptions } from '../types'; | ||
import { Session } from './Session'; | ||
interface CreateSessionParams { | ||
/** | ||
* Should save to sessionStorage? | ||
*/ | ||
stickySession: boolean; | ||
/** | ||
* The sampling rate of the Session. See integration configuration comments | ||
* for `replaysSamplingRate`. | ||
*/ | ||
samplingRate?: number; | ||
} | ||
/** | ||
@@ -18,3 +8,2 @@ * Create a new session, which in its current implementation is a Sentry event | ||
*/ | ||
export declare function createSession({ stickySession, samplingRate, }: CreateSessionParams): Session; | ||
export {}; | ||
export declare function createSession({ sessionSampleRate, errorSampleRate, stickySession, }: SessionOptions): Session; |
@@ -0,1 +1,2 @@ | ||
import { SampleRates } from '../types'; | ||
import { Session } from './Session'; | ||
@@ -5,2 +6,2 @@ /** | ||
*/ | ||
export declare function fetchSession(): Session | null; | ||
export declare function fetchSession({ sessionSampleRate, errorSampleRate, }: SampleRates): Session | null; |
@@ -0,3 +1,4 @@ | ||
import { SessionOptions } from '../types'; | ||
import { Session } from './Session'; | ||
interface GetSessionParams { | ||
interface GetSessionParams extends SessionOptions { | ||
/** | ||
@@ -8,14 +9,5 @@ * The length of time (in ms) which we will consider the session to be expired. | ||
/** | ||
* Should save session to sessionStorage? | ||
*/ | ||
stickySession: boolean; | ||
/** | ||
* The current session (e.g. if stickySession is off) | ||
*/ | ||
currentSession?: Session; | ||
/** | ||
* The sampling rate of the Session. See integration configuration comments | ||
* for `replaysSamplingRate`. | ||
*/ | ||
samplingRate?: number; | ||
} | ||
@@ -25,3 +17,3 @@ /** | ||
*/ | ||
export declare function getSession({ expiry, currentSession, stickySession, samplingRate, }: GetSessionParams): { | ||
export declare function getSession({ expiry, currentSession, stickySession, sessionSampleRate, errorSampleRate, }: GetSessionParams): { | ||
type: string; | ||
@@ -28,0 +20,0 @@ session: Session; |
@@ -0,1 +1,3 @@ | ||
import { SampleRates, SessionOptions } from '../types'; | ||
declare type StickyOption = Required<Pick<SessionOptions, 'stickySession'>>; | ||
interface SessionObject { | ||
@@ -20,6 +22,2 @@ id: string; | ||
} | ||
interface SessionOptions { | ||
stickySession?: boolean; | ||
samplingRate?: number; | ||
} | ||
export declare class Session { | ||
@@ -50,4 +48,4 @@ /** | ||
private _sampled; | ||
readonly options: Required<Pick<SessionOptions, 'stickySession'>>; | ||
constructor(session?: Partial<SessionObject>, { stickySession, samplingRate }?: SessionOptions); | ||
readonly options: StickyOption; | ||
constructor(session: Partial<SessionObject> | undefined, { stickySession, sessionSampleRate, errorSampleRate, }: StickyOption & SampleRates); | ||
get id(): string; | ||
@@ -54,0 +52,0 @@ get started(): number; |
@@ -36,20 +36,38 @@ import type { eventWithTime, recordOptions } from 'rrweb/typings/types'; | ||
} | ||
export interface ReplayPluginOptions { | ||
export interface SampleRates { | ||
/** | ||
* The sample rate for session-long replays. 1.0 will record all sessions and | ||
* 0 will record none. | ||
*/ | ||
sessionSampleRate: number; | ||
/** | ||
* The sample rate for sessions that has had an error occur. This is | ||
* independent of `sessionSampleRate`. | ||
*/ | ||
errorSampleRate: number; | ||
} | ||
/** | ||
* Session options that are configurable by the integration configuration | ||
*/ | ||
export interface SessionOptions extends SampleRates { | ||
/** | ||
* If false, will create a new session per pageload. Otherwise, saves session | ||
* to Session Storage. | ||
*/ | ||
stickySession: boolean; | ||
} | ||
export interface ReplayPluginOptions extends SessionOptions { | ||
/** | ||
* The amount of time to wait before sending a replay | ||
*/ | ||
flushMinDelay?: number; | ||
flushMinDelay: number; | ||
/** | ||
* The max amount of time to wait before sending a replay | ||
*/ | ||
flushMaxDelay?: number; | ||
flushMaxDelay: number; | ||
/** | ||
* The amount of time to buffer the initial snapshot | ||
*/ | ||
initialFlushDelay?: number; | ||
initialFlushDelay: number; | ||
/** | ||
* If false, will create a new session per pageload | ||
*/ | ||
stickySession?: boolean; | ||
/** | ||
* Attempt to use compression when web workers are available | ||
@@ -59,9 +77,15 @@ * | ||
*/ | ||
useCompression?: boolean; | ||
useCompression: boolean; | ||
/** | ||
* Only capture replays when an error happens | ||
* | ||
* @deprecated | ||
* @see errorSampleRate | ||
*/ | ||
captureOnlyOnError?: boolean; | ||
/** | ||
* The sampling rate for replays. 1.0 will record all replays, 0 will record none. | ||
* The sample rate for replays. 1.0 will record all replays, 0 will record none. | ||
* | ||
* @deprecated | ||
* @see sessionSampleRate | ||
*/ | ||
@@ -72,9 +96,10 @@ replaysSamplingRate?: number; | ||
*/ | ||
maskAllText?: boolean; | ||
maskAllText: boolean; | ||
/** | ||
* Block all media (e.g. images, svg, video) in recordings. | ||
*/ | ||
blockAllMedia?: boolean; | ||
blockAllMedia: boolean; | ||
} | ||
export interface ReplayConfiguration extends ReplayPluginOptions, RecordingOptions { | ||
declare type OptionalReplayPluginOptions = Partial<ReplayPluginOptions>; | ||
export interface ReplayConfiguration extends OptionalReplayPluginOptions, RecordingOptions { | ||
} | ||
@@ -109,1 +134,2 @@ /** | ||
} | ||
export {}; |
@@ -7,2 +7,2 @@ /** | ||
*/ | ||
export declare function isSampled(sampleRate: number): boolean; | ||
export declare function isSampled(sampleRate?: number): boolean; |
@@ -43,3 +43,2 @@ import { Breadcrumb, Event, Integration } from '@sentry/types'; | ||
/** | ||
* | ||
* Paused is a state where: | ||
@@ -51,2 +50,7 @@ * - DOM Recording is not listening at all | ||
/** | ||
* Integration will wait until an error occurs before creating and sending a | ||
* replay. | ||
*/ | ||
private waitForError; | ||
/** | ||
* Have we attached listeners to the core SDK? | ||
@@ -66,3 +70,3 @@ * Note we have to track this as there is no way to remove instrumentation handlers. | ||
session: Session | undefined; | ||
constructor({ flushMinDelay, flushMaxDelay, initialFlushDelay, stickySession, useCompression, captureOnlyOnError, replaysSamplingRate, maskAllText, maskAllInputs, blockAllMedia, blockClass, ignoreClass, maskTextClass, blockSelector, ...recordingOptions }?: ReplayConfiguration); | ||
constructor({ flushMinDelay, flushMaxDelay, initialFlushDelay, stickySession, useCompression, sessionSampleRate, errorSampleRate, maskAllText, maskAllInputs, blockAllMedia, blockClass, ignoreClass, maskTextClass, blockSelector, replaysSamplingRate, captureOnlyOnError, ...recordingOptions }?: ReplayConfiguration); | ||
/** | ||
@@ -240,3 +244,3 @@ * Because we create a transaction in `setupOnce`, we can potentially create a | ||
/** | ||
* Only flush if `captureOnlyOnError` is false. | ||
* Only flush if `this.waitForError` is false. | ||
*/ | ||
@@ -277,3 +281,3 @@ conditionalFlush(): void; | ||
*/ | ||
flushImmediate(): void; | ||
flushImmediate(): any; | ||
/** | ||
@@ -280,0 +284,0 @@ * Send replay attachment using `fetch()` |
@@ -7,1 +7,6 @@ export declare const REPLAY_SESSION_KEY = "sentryReplaySession"; | ||
export declare const MAX_SESSION_LIFE = 1800000; | ||
/** | ||
* Defaults for sampling rates | ||
*/ | ||
export declare const DEFAULT_SESSION_SAMPLE_RATE = 0.1; | ||
export declare const DEFAULT_ERROR_SAMPLE_RATE = 1; |
@@ -0,13 +1,3 @@ | ||
import { SessionOptions } from '../types'; | ||
import { Session } from './Session'; | ||
interface CreateSessionParams { | ||
/** | ||
* Should save to sessionStorage? | ||
*/ | ||
stickySession: boolean; | ||
/** | ||
* The sampling rate of the Session. See integration configuration comments | ||
* for `replaysSamplingRate`. | ||
*/ | ||
samplingRate?: number; | ||
} | ||
/** | ||
@@ -18,3 +8,2 @@ * Create a new session, which in its current implementation is a Sentry event | ||
*/ | ||
export declare function createSession({ stickySession, samplingRate, }: CreateSessionParams): Session; | ||
export {}; | ||
export declare function createSession({ sessionSampleRate, errorSampleRate, stickySession, }: SessionOptions): Session; |
@@ -0,1 +1,2 @@ | ||
import { SampleRates } from '../types'; | ||
import { Session } from './Session'; | ||
@@ -5,2 +6,2 @@ /** | ||
*/ | ||
export declare function fetchSession(): Session | null; | ||
export declare function fetchSession({ sessionSampleRate, errorSampleRate, }: SampleRates): Session | null; |
@@ -0,3 +1,4 @@ | ||
import { SessionOptions } from '../types'; | ||
import { Session } from './Session'; | ||
interface GetSessionParams { | ||
interface GetSessionParams extends SessionOptions { | ||
/** | ||
@@ -8,14 +9,5 @@ * The length of time (in ms) which we will consider the session to be expired. | ||
/** | ||
* Should save session to sessionStorage? | ||
*/ | ||
stickySession: boolean; | ||
/** | ||
* The current session (e.g. if stickySession is off) | ||
*/ | ||
currentSession?: Session; | ||
/** | ||
* The sampling rate of the Session. See integration configuration comments | ||
* for `replaysSamplingRate`. | ||
*/ | ||
samplingRate?: number; | ||
} | ||
@@ -25,3 +17,3 @@ /** | ||
*/ | ||
export declare function getSession({ expiry, currentSession, stickySession, samplingRate, }: GetSessionParams): { | ||
export declare function getSession({ expiry, currentSession, stickySession, sessionSampleRate, errorSampleRate, }: GetSessionParams): { | ||
type: string; | ||
@@ -28,0 +20,0 @@ session: Session; |
@@ -0,1 +1,3 @@ | ||
import { SampleRates, SessionOptions } from '../types'; | ||
declare type StickyOption = Required<Pick<SessionOptions, 'stickySession'>>; | ||
interface SessionObject { | ||
@@ -20,6 +22,2 @@ id: string; | ||
} | ||
interface SessionOptions { | ||
stickySession?: boolean; | ||
samplingRate?: number; | ||
} | ||
export declare class Session { | ||
@@ -50,4 +48,4 @@ /** | ||
private _sampled; | ||
readonly options: Required<Pick<SessionOptions, 'stickySession'>>; | ||
constructor(session?: Partial<SessionObject>, { stickySession, samplingRate }?: SessionOptions); | ||
readonly options: StickyOption; | ||
constructor(session: Partial<SessionObject> | undefined, { stickySession, sessionSampleRate, errorSampleRate, }: StickyOption & SampleRates); | ||
get id(): string; | ||
@@ -54,0 +52,0 @@ get started(): number; |
@@ -36,20 +36,38 @@ import type { eventWithTime, recordOptions } from 'rrweb/typings/types'; | ||
} | ||
export interface ReplayPluginOptions { | ||
export interface SampleRates { | ||
/** | ||
* The sample rate for session-long replays. 1.0 will record all sessions and | ||
* 0 will record none. | ||
*/ | ||
sessionSampleRate: number; | ||
/** | ||
* The sample rate for sessions that has had an error occur. This is | ||
* independent of `sessionSampleRate`. | ||
*/ | ||
errorSampleRate: number; | ||
} | ||
/** | ||
* Session options that are configurable by the integration configuration | ||
*/ | ||
export interface SessionOptions extends SampleRates { | ||
/** | ||
* If false, will create a new session per pageload. Otherwise, saves session | ||
* to Session Storage. | ||
*/ | ||
stickySession: boolean; | ||
} | ||
export interface ReplayPluginOptions extends SessionOptions { | ||
/** | ||
* The amount of time to wait before sending a replay | ||
*/ | ||
flushMinDelay?: number; | ||
flushMinDelay: number; | ||
/** | ||
* The max amount of time to wait before sending a replay | ||
*/ | ||
flushMaxDelay?: number; | ||
flushMaxDelay: number; | ||
/** | ||
* The amount of time to buffer the initial snapshot | ||
*/ | ||
initialFlushDelay?: number; | ||
initialFlushDelay: number; | ||
/** | ||
* If false, will create a new session per pageload | ||
*/ | ||
stickySession?: boolean; | ||
/** | ||
* Attempt to use compression when web workers are available | ||
@@ -59,9 +77,15 @@ * | ||
*/ | ||
useCompression?: boolean; | ||
useCompression: boolean; | ||
/** | ||
* Only capture replays when an error happens | ||
* | ||
* @deprecated | ||
* @see errorSampleRate | ||
*/ | ||
captureOnlyOnError?: boolean; | ||
/** | ||
* The sampling rate for replays. 1.0 will record all replays, 0 will record none. | ||
* The sample rate for replays. 1.0 will record all replays, 0 will record none. | ||
* | ||
* @deprecated | ||
* @see sessionSampleRate | ||
*/ | ||
@@ -72,9 +96,10 @@ replaysSamplingRate?: number; | ||
*/ | ||
maskAllText?: boolean; | ||
maskAllText: boolean; | ||
/** | ||
* Block all media (e.g. images, svg, video) in recordings. | ||
*/ | ||
blockAllMedia?: boolean; | ||
blockAllMedia: boolean; | ||
} | ||
export interface ReplayConfiguration extends ReplayPluginOptions, RecordingOptions { | ||
declare type OptionalReplayPluginOptions = Partial<ReplayPluginOptions>; | ||
export interface ReplayConfiguration extends OptionalReplayPluginOptions, RecordingOptions { | ||
} | ||
@@ -109,1 +134,2 @@ /** | ||
} | ||
export {}; |
@@ -7,2 +7,2 @@ /** | ||
*/ | ||
export declare function isSampled(sampleRate: number): boolean; | ||
export declare function isSampled(sampleRate?: number): boolean; |
{ | ||
"name": "@sentry/replay", | ||
"version": "0.6.10", | ||
"version": "0.6.11-0", | ||
"description": "User replays for Sentry", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -38,4 +38,8 @@ # sentry-replay | ||
// in development and sample at a lower rate in production | ||
replaysSamplingRate: 0.1, | ||
sessionSampleRate: 0.1, | ||
// If the entire session is not sampled, use the below sample rate to sample | ||
// sessions when an error occurs. | ||
errorSampleRate: 1.0, | ||
// Mask all text content with asterisks (*). Passes text | ||
@@ -83,8 +87,7 @@ // content through to `maskTextFn` before sending to server. | ||
| key | type | default | description | | ||
| ------------------- | ------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| captureOnlyOnError | boolean | `false` | Only capture the recording when an error happens. The recording is currently limited to up to the last 60 seconds before the error occurs and only records up to the error. | | ||
| 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. | | ||
| replaysSamplingRate | number | `1.0` | The rate at which to sample replays. (1.0 will collect all replays, 0 will collect no replays). | | ||
| 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 | | ||
| ------------------- | ------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| sessionSampleRate | number | `0.1` | The sample rate for all sessions, which will capture the entirety from when a user begins a session until the session ends. (1.0 will collect all replays, 0 will collect no replays) | | ||
| errorSampleRate | number | `1.0` | If a session isn't already being recorded via `sessionSampleRate`, based on `errorSampleRate` the SDK will send the captured replay when an error occurs. (1.0 capturing all sessions with an error, and 0 capturing none). | | ||
| 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. | | ||
@@ -91,0 +94,0 @@ ### Privacy Configuration |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
529435
5920
133