@@ -28,9 +28,17 @@ import type { ViewOptions } from '../domain/view/trackViews'
2828import type { DurationVital , CustomVitalsState } from '../domain/vital/vitalCollection'
2929import { startDurationVital , stopDurationVital } from '../domain/vital/vitalCollection'
3030import { callPluginsMethod } from '../domain/plugins'
31+ import { createStreamPlugin } from '../domain/stream'
3132import type { StartRumResult } from './startRum'
3233import type { RumPublicApiOptions , Strategy } from './rumPublicApi'
3334
35+ declare global {
36+ interface Window {
37+ DD_STREAM_PLUGIN : ReturnType < typeof createStreamPlugin >
38+ DD_STREAM : ReturnType < ReturnType < typeof createStreamPlugin > [ 'createStream' ] >
39+ }
40+ }
41+
3442export function createPreStartStrategy (
3543 { ignoreInitIfSyntheticsWillInjectRum = true , startDeflateWorker } : RumPublicApiOptions ,
3644 trackingConsentState : TrackingConsentState ,
@@ -158,6 +166,10 @@ export function createPreStartStrategy(
158166 initFeatureFlags ( initConfiguration . enableExperimentalFeatures )
159167
160168 // Expose the initial configuration regardless of initialization success.
169+ window . DD_STREAM_PLUGIN = createStreamPlugin ( )
170+ window . DD_STREAM = window . DD_STREAM_PLUGIN . createStream ( )
171+
172+ initConfiguration . plugins = ( initConfiguration . plugins ?? [ ] ) . concat ( [ window . DD_STREAM_PLUGIN . plugin ] )
161173 cachedInitConfiguration = initConfiguration
162174
163175 // If we are in a Synthetics test configured to automatically inject a RUM instance, we want
0 commit comments