Skip to content

Commit c51875b

Browse files
committed
add canvas to options event
1 parent a754dd4 commit c51875b

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

packages/replay/src/replay.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,13 @@ export class ReplayContainer implements ReplayContainerInterface {
223223
return this._isPaused;
224224
}
225225

226+
/**
227+
* Determine if canvas recording is enabled
228+
*/
229+
public isRecordingCanvas(): boolean {
230+
return Boolean(this._canvas);
231+
}
232+
226233
/** Get the replay integration options. */
227234
public getOptions(): ReplayPluginOptions {
228235
return this._options;

packages/replay/src/types/replay.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,7 @@ export interface ReplayContainer {
485485
) => typeof THROTTLED | typeof SKIPPED | Promise<AddEventResult | null>;
486486
isEnabled(): boolean;
487487
isPaused(): boolean;
488+
isRecordingCanvas(): boolean;
488489
getContext(): InternalEventContext;
489490
initializeSampling(): void;
490491
start(): void;

packages/replay/src/types/replayFrame.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ export interface ReplayMultiClickFrame extends ReplayBaseBreadcrumbFrame {
114114

115115
interface ReplayOptionFrame {
116116
blockAllMedia: boolean;
117+
canvas: boolean;
117118
errorSampleRate: number;
118119
maskAllInputs: boolean;
119120
maskAllText: boolean;

packages/replay/src/util/handleRecordingEmit.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ export function createOptionsEvent(replay: ReplayContainer): ReplayOptionFrameEv
122122
data: {
123123
tag: 'options',
124124
payload: {
125+
canvas: replay.isRecordingCanvas(),
125126
sessionSampleRate: options.sessionSampleRate,
126127
errorSampleRate: options.errorSampleRate,
127128
useCompressionOption: options.useCompression,

0 commit comments

Comments
 (0)