@@ -38,6 +38,7 @@ import type {
3838 RecordingEvent ,
3939 RecordingOptions ,
4040 ReplayBreadcrumbFrame ,
41+ ReplayCanvasIntegrationOptions ,
4142 ReplayContainer as ReplayContainerInterface ,
4243 ReplayPerformanceEntry ,
4344 ReplayPluginOptions ,
@@ -145,9 +146,9 @@ export class ReplayContainer implements ReplayContainerInterface {
145146 private _context : InternalEventContext ;
146147
147148 /**
148- * Internal integrations (e.g. canvas)
149+ * Internal use for canvas recording options
149150 */
150- private _integrations : Record < string , Record < string , unknown > > ;
151+ private _canvas : ReplayCanvasIntegrationOptions | undefined ;
151152
152153 public constructor ( {
153154 options,
@@ -167,7 +168,6 @@ export class ReplayContainer implements ReplayContainerInterface {
167168 this . _lastActivity = Date . now ( ) ;
168169 this . _isEnabled = false ;
169170 this . _isPaused = false ;
170- this . _integrations = { } ;
171171 this . _hasInitializedCoreListeners = false ;
172172 this . _context = {
173173 errorIds : new Set ( ) ,
@@ -228,11 +228,6 @@ export class ReplayContainer implements ReplayContainerInterface {
228228 return this . _options ;
229229 }
230230
231- /** Get the replay integrations. [test only] */
232- public getIntegrations ( ) : Record < string , Record < string , unknown > > {
233- return { ...this . _integrations } ;
234- }
235-
236231 /**
237232 * Initializes the plugin based on sampling configuration. Should not be
238233 * called outside of constructor.
@@ -348,7 +343,7 @@ export class ReplayContainer implements ReplayContainerInterface {
348343 */
349344 public startRecording ( ) : void {
350345 try {
351- const { canvas } = this . _integrations ;
346+ const canvasOptions = this . _canvas ;
352347
353348 this . _stopRecording = record ( {
354349 ...this . _recordingOptions ,
@@ -358,7 +353,14 @@ export class ReplayContainer implements ReplayContainerInterface {
358353 ...( this . recordingMode === 'buffer' && { checkoutEveryNms : BUFFER_CHECKOUT_TIME } ) ,
359354 emit : getHandleRecordingEmit ( this ) ,
360355 onMutation : this . _onMutationHandler ,
361- ...canvas ,
356+ ...( canvasOptions
357+ ? {
358+ recordCanvas : canvasOptions . recordCanvas ,
359+ getCanvasManager : canvasOptions . getCanvasManager ,
360+ sampling : canvasOptions . sampling ,
361+ dataURLOptions : canvasOptions . dataURLOptions ,
362+ }
363+ : { } ) ,
362364 } ) ;
363365 } catch ( err ) {
364366 this . _handleException ( err ) ;
@@ -723,13 +725,6 @@ export class ReplayContainer implements ReplayContainerInterface {
723725 return spanToJSON ( lastTransaction ) . description ;
724726 }
725727
726- /**
727- * Internal integration use only, should not be public
728- */
729- public addIntegration ( name : string , options : Record < string , unknown > ) : void {
730- this . _integrations [ name ] = options ;
731- }
732-
733728 /**
734729 * Initialize and start all listeners to varying events (DOM,
735730 * Performance Observer, Recording, Sentry SDK, etc)
0 commit comments