@@ -3,31 +3,45 @@ import { initialize as init } from 'launchdarkly-js-client-sdk'
33import Observability from '@launchdarkly/observability'
44import SessionReplay from '@launchdarkly/session-replay'
55// import { LD } from '@launchdarkly/browser'
6+ // import { withLDProvider } from 'launchdarkly-react-client-sdk'
7+
8+ const observabilitySettings : ConstructorParameters < typeof Observability > [ 0 ] = {
9+ networkRecording : {
10+ enabled : true ,
11+ recordHeadersAndBody : true ,
12+ } ,
13+ serviceName : 'ryan-test' ,
14+ backendUrl : 'https://pub.observability.ld-stg.launchdarkly.com' ,
15+ otel : {
16+ otlpEndpoint : 'https://otel.observability.ld-stg.launchdarkly.com' ,
17+ } ,
18+ }
19+ const sessionReplaySettings : ConstructorParameters < typeof SessionReplay > [ 0 ] = {
20+ debug : { clientInteractions : true , domRecording : true } ,
21+ privacySetting : 'none' ,
22+ serviceName : 'ryan-test' ,
23+ backendUrl : 'https://pub.observability.ld-stg.launchdarkly.com' ,
24+ }
625
726export const client = init (
827 '66d9d3c255856f0fa8fd62d0' ,
928 { key : 'unknown' } ,
1029 {
1130 // Not including plugins at all would be equivalent to the current LaunchDarkly SDK.
1231 plugins : [
13- new Observability ( '1' , {
14- networkRecording : {
15- enabled : true ,
16- recordHeadersAndBody : true ,
17- } ,
18- serviceName : 'ryan-test' ,
19- backendUrl : 'https://pub.observability.ld-stg.launchdarkly.com' ,
20- otel : {
21- otlpEndpoint :
22- 'https://otel.observability.ld-stg.launchdarkly.com' ,
23- } ,
24- } ) ,
25- new SessionReplay ( '1' , {
26- debug : { clientInteractions : true , domRecording : true } ,
27- privacySetting : 'none' ,
28- serviceName : 'ryan-test' ,
29- backendUrl : 'https://pub.observability.ld-stg.launchdarkly.com' ,
30- } ) , // Could be omitted for customers who cannot use session replay.
32+ new Observability ( observabilitySettings ) ,
33+ new SessionReplay ( sessionReplaySettings ) ,
3134 ] ,
3235 } ,
3336)
37+
38+ /*export const LDProvider = withLDProvider({
39+ clientSideID: '66d9d3c255856f0fa8fd62d0',
40+ context: { key: 'unknown' },
41+ options: {
42+ plugins: [
43+ new Observability(observabilitySettings),
44+ new SessionReplay(sessionReplaySettings),
45+ ],
46+ },
47+ })*/
0 commit comments