@@ -162,10 +162,7 @@ export default function mParticleInstance(this: IMParticleWebSDKInstance, instan
162162 ) ;
163163 }
164164
165- const kitBlocker = createKitBlocker ( config , this ) ;
166- runPreConfigFetchInitialization ( this , apiKey , config , kitBlocker ) ;
167- debugger ;
168- this . Logger . error ( 'gt error test' ) ;
165+ runPreConfigFetchInitialization ( this , apiKey , config ) ;
169166
170167 // config code - Fetch config when requestConfig = true, otherwise, proceed with SDKInitialization
171168 // Since fetching the configuration is asynchronous, we must pass completeSDKInitialization
@@ -188,10 +185,10 @@ export default function mParticleInstance(this: IMParticleWebSDKInstance, instan
188185 result
189186 ) ;
190187
191- completeSDKInitialization ( apiKey , mergedConfig , this , kitBlocker ) ;
188+ completeSDKInitialization ( apiKey , mergedConfig , this ) ;
192189 } ) ;
193190 } else {
194- completeSDKInitialization ( apiKey , config , this , kitBlocker ) ;
191+ completeSDKInitialization ( apiKey , config , this ) ;
195192 }
196193 } else {
197194 console . error (
@@ -1364,9 +1361,11 @@ export default function mParticleInstance(this: IMParticleWebSDKInstance, instan
13641361}
13651362
13661363// Some (server) config settings need to be returned before they are set on SDKConfig in a self hosted environment
1367- function completeSDKInitialization ( apiKey , config , mpInstance , kitBlocker : KitBlocker ) {
1364+ function completeSDKInitialization ( apiKey , config , mpInstance ) {
1365+ const kitBlocker = createKitBlocker ( config , mpInstance ) ;
13681366 const { getFeatureFlag } = mpInstance . _Helpers ;
13691367
1368+ mpInstance . _APIClient = new APIClient ( mpInstance , kitBlocker ) ;
13701369 mpInstance . _Forwarders = new Forwarders ( mpInstance , kitBlocker ) ;
13711370 mpInstance . _Store . processConfig ( config ) ;
13721371
@@ -1550,9 +1549,8 @@ function createIdentityCache(mpInstance) {
15501549 } ) ;
15511550}
15521551
1553- function runPreConfigFetchInitialization ( mpInstance , apiKey , config , kitBlocker : KitBlocker ) {
1554- mpInstance . _APIClient = new APIClient ( mpInstance , kitBlocker ) ;
1555- mpInstance . Logger = new Logger ( config , mpInstance . _APIClient ) ;
1552+ function runPreConfigFetchInitialization ( mpInstance , apiKey , config ) {
1553+ mpInstance . Logger = new Logger ( config ) ;
15561554 mpInstance . _Store = new Store ( config , mpInstance , apiKey ) ;
15571555 window . mParticle . Store = mpInstance . _Store ;
15581556 mpInstance . Logger . verbose ( StartingInitialization ) ;
0 commit comments