@@ -12,7 +12,6 @@ import { logger } from '@sentry/utils';
1212
1313import {
1414 BUFFER_CHECKOUT_TIME ,
15- CANVAS_QUALITY ,
1615 SESSION_IDLE_EXPIRE_DURATION ,
1716 SESSION_IDLE_PAUSE_DURATION ,
1817 SLOW_CLICK_SCROLL_TIMEOUT ,
@@ -145,6 +144,11 @@ export class ReplayContainer implements ReplayContainerInterface {
145144
146145 private _context : InternalEventContext ;
147146
147+ /**
148+ * Internal integrations (e.g. canvas)
149+ */
150+ private _integrations : Record < string , Record < string , unknown > > ;
151+
148152 public constructor ( {
149153 options,
150154 recordingOptions,
@@ -163,6 +167,7 @@ export class ReplayContainer implements ReplayContainerInterface {
163167 this . _lastActivity = Date . now ( ) ;
164168 this . _isEnabled = false ;
165169 this . _isPaused = false ;
170+ this . _integrations = { } ;
166171 this . _hasInitializedCoreListeners = false ;
167172 this . _context = {
168173 errorIds : new Set ( ) ,
@@ -338,7 +343,8 @@ export class ReplayContainer implements ReplayContainerInterface {
338343 */
339344 public startRecording ( ) : void {
340345 try {
341- const canvas = this . _options . _experiments . canvas ;
346+ const { canvas } = this . _integrations ;
347+
342348 this . _stopRecording = record ( {
343349 ...this . _recordingOptions ,
344350 // When running in error sampling mode, we need to overwrite `checkoutEveryNms`
@@ -347,12 +353,7 @@ export class ReplayContainer implements ReplayContainerInterface {
347353 ...( this . recordingMode === 'buffer' && { checkoutEveryNms : BUFFER_CHECKOUT_TIME } ) ,
348354 emit : getHandleRecordingEmit ( this ) ,
349355 onMutation : this . _onMutationHandler ,
350- ...( canvas &&
351- canvas . manager && {
352- recordCanvas : true ,
353- getCanvasManager : canvas . manager ,
354- ...( CANVAS_QUALITY [ canvas . quality || 'medium' ] || CANVAS_QUALITY . medium ) ,
355- } ) ,
356+ ...canvas ,
356357 } ) ;
357358 } catch ( err ) {
358359 this . _handleException ( err ) ;
@@ -717,6 +718,13 @@ export class ReplayContainer implements ReplayContainerInterface {
717718 return spanToJSON ( lastTransaction ) . description ;
718719 }
719720
721+ /**
722+ * Internal integration use only, should not be public
723+ */
724+ public addIntegration ( name : string , options : Record < string , unknown > ) : void {
725+ this . _integrations [ name ] = options ;
726+ }
727+
720728 /**
721729 * Initialize and start all listeners to varying events (DOM,
722730 * Performance Observer, Recording, Sentry SDK, etc)
0 commit comments