@@ -13,13 +13,13 @@ import {
1313 LDHeaders ,
1414 Platform ,
1515} from '@launchdarkly/js-client-sdk-common' ;
16+ import { LDIdentifyOptions } from '@launchdarkly/js-client-sdk-common/dist/api/LDIdentifyOptions' ;
1617
1718import BrowserDataManager from './BrowserDataManager' ;
1819import GoalManager from './goals/GoalManager' ;
1920import { Goal , isClick } from './goals/Goals' ;
2021import validateOptions , { BrowserOptions , filterToBaseOptions } from './options' ;
2122import BrowserPlatform from './platform/BrowserPlatform' ;
22- import { LDIdentifyOptions } from '@launchdarkly/js-client-sdk-common/dist/api/LDIdentifyOptions' ;
2323
2424/**
2525 * We are not supporting dynamically setting the connection mode on the LDClient.
@@ -53,7 +53,6 @@ export class BrowserClient extends LDClientImpl {
5353 const baseUrl = options . baseUri ?? 'https://clientsdk.launchdarkly.com' ;
5454
5555 const platform = overridePlatform ?? new BrowserPlatform ( logger ) ;
56- < < < << << HEAD
5756 const validatedBrowserOptions = validateOptions ( options , logger ) ;
5857 const { eventUrlTransformer } = validatedBrowserOptions ;
5958 super (
@@ -111,26 +110,8 @@ export class BrowserClient extends LDClientImpl {
111110 ) ,
112111 } ,
113112 ) ;
114- = === ===
115- const ValidatedBrowserOptions = validateOptions ( options , logger ) ;
116- const { eventUrlTransformer } = ValidatedBrowserOptions ;
117- super ( clientSideId , autoEnvAttributes , platform , filterToBaseOptions ( options ) , {
118- analyticsEventPath : `/events/bulk/${ clientSideId } ` ,
119- diagnosticEventPath : `/events/diagnostic/${ clientSideId } ` ,
120- includeAuthorizationHeader : false ,
121- highTimeoutThreshold : 5 ,
122- userAgentHeaderName : 'x-launchdarkly-user-agent' ,
123- trackEventModifier : ( event : internal . InputCustomEvent ) =>
124- new internal . InputCustomEvent (
125- event . context ,
126- event . key ,
127- event . data ,
128- event . metricValue ,
129- event . samplingRatio ,
130- eventUrlTransformer ( window . location . href ) ,
131- ) ,
132- } ) ;
133- > >>> >>> origin / rlamb / fix - browser - contract - test - build
113+
114+ this . setEventSendingEnabled ( true , false ) ;
134115
135116 if ( validatedBrowserOptions . fetchGoals ) {
136117 this . goalManager = new GoalManager (
@@ -178,8 +159,8 @@ export class BrowserClient extends LDClientImpl {
178159 }
179160 }
180161
181- override async identify ( context : LDContext ) : Promise < void > {
182- await super . identify ( context ) ;
162+ override async identify ( context : LDContext , identifyOptions : LDIdentifyOptions ) : Promise < void > {
163+ await super . identify ( context , identifyOptions ) ;
183164 this . goalManager ?. startTracking ( ) ;
184165 }
185166
@@ -192,24 +173,5 @@ export class BrowserClient extends LDClientImpl {
192173 }
193174 }
194175
195- < << << << HEAD
196176 // TODO: Setup event listeners.
197- = = === ==
198- override getPollingPaths ( ) : DataSourcePaths {
199- const parentThis = this ;
200- return {
201- pathGet ( encoding : Encoding , _plainContextString : string ) : string {
202- return `/sdk/evalx/${ parentThis . clientSideId } /contexts/${ base64UrlEncode ( _plainContextString , encoding ) } ` ;
203- } ,
204- pathReport ( _encoding : Encoding , _plainContextString : string ) : string {
205- return `/sdk/evalx/${ parentThis . clientSideId } /context` ;
206- } ,
207- } ;
208- }
209-
210- override async identify ( context : LDContext , identifyOptions ?: LDIdentifyOptions ) : Promise < void > {
211- await super . identify ( context , identifyOptions ) ;
212- this . goalManager ?. startTracking ( ) ;
213- }
214- > >>> >>> origin / rlamb / fix - browser - contract - test - build
215177}
0 commit comments