Skip to content

Commit 45fda50

Browse files
chore(build): Generate latest bundle [skip ci]
1 parent b2d1557 commit 45fda50

2 files changed

Lines changed: 78 additions & 54 deletions

File tree

dist/Rokt-Kit.common.js

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -334,35 +334,40 @@ var constructor = function () {
334334
launcherOptions || {}
335335
);
336336

337-
window.Rokt.createLauncher(options)
338-
.then(function (launcher) {
339-
// Assign the launcher to a global variable for later access
340-
window.Rokt.currentLauncher = launcher;
341-
// Locally cache the launcher and filters
342-
self.launcher = launcher;
337+
if (isPartnerInLocalLauncherTestGroup()) {
338+
var localLauncher = window.Rokt.createLocalLauncher(options);
339+
initRoktLauncher(localLauncher);
340+
} else {
341+
window.Rokt.createLauncher(options)
342+
.then(initRoktLauncher)
343+
.catch(function (err) {
344+
console.error('Error creating Rokt launcher:', err);
345+
});
346+
}
347+
}
343348

344-
var roktFilters = window.mParticle.Rokt.filters;
349+
function initRoktLauncher(launcher) {
350+
// Assign the launcher to a global variable for later access
351+
window.Rokt.currentLauncher = launcher;
352+
// Locally cache the launcher and filters
353+
self.launcher = launcher;
345354

346-
if (!roktFilters) {
347-
console.warn('Rokt Kit: No filters have been set.');
348-
} else {
349-
self.filters = roktFilters;
350-
if (!roktFilters.filteredUser) {
351-
console.warn(
352-
'Rokt Kit: No filtered user has been set.'
353-
);
354-
}
355-
}
355+
var roktFilters = window.mParticle.Rokt.filters;
356356

357-
// Kit must be initialized before attaching to the Rokt manager
358-
self.isInitialized = true;
359-
// Attaches the kit to the Rokt manager
360-
window.mParticle.Rokt.attachKit(self);
361-
processEventQueue();
362-
})
363-
.catch(function (err) {
364-
console.error('Error creating Rokt launcher:', err);
365-
});
357+
if (!roktFilters) {
358+
console.warn('Rokt Kit: No filters have been set.');
359+
} else {
360+
self.filters = roktFilters;
361+
if (!roktFilters.filteredUser) {
362+
console.warn('Rokt Kit: No filtered user has been set.');
363+
}
364+
}
365+
366+
// Kit must be initialized before attaching to the Rokt manager
367+
self.isInitialized = true;
368+
// Attaches the kit to the Rokt manager
369+
window.mParticle.Rokt.attachKit(self);
370+
processEventQueue();
366371
}
367372

368373
// mParticle Kit Callback Methods
@@ -430,11 +435,18 @@ var constructor = function () {
430435
function isKitReady() {
431436
return !!(self.isInitialized && self.launcher);
432437
}
438+
439+
function isPartnerInLocalLauncherTestGroup() {
440+
return (
441+
window.mParticle.config &&
442+
window.mParticle.config.isLocalLauncherEnabled
443+
);
444+
}
433445
};
434446

435447
function generateIntegrationName(customIntegrationName) {
436448
var coreSdkVersion = window.mParticle.getVersion();
437-
var kitVersion = "1.8.1";
449+
var kitVersion = "1.9.0";
438450
var name = 'mParticle_' + 'wsdkv_' + coreSdkVersion + '_kitv_' + kitVersion;
439451

440452
if (customIntegrationName) {

dist/Rokt-Kit.iife.js

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -333,35 +333,40 @@ var RoktKit = (function (exports) {
333333
launcherOptions || {}
334334
);
335335

336-
window.Rokt.createLauncher(options)
337-
.then(function (launcher) {
338-
// Assign the launcher to a global variable for later access
339-
window.Rokt.currentLauncher = launcher;
340-
// Locally cache the launcher and filters
341-
self.launcher = launcher;
336+
if (isPartnerInLocalLauncherTestGroup()) {
337+
var localLauncher = window.Rokt.createLocalLauncher(options);
338+
initRoktLauncher(localLauncher);
339+
} else {
340+
window.Rokt.createLauncher(options)
341+
.then(initRoktLauncher)
342+
.catch(function (err) {
343+
console.error('Error creating Rokt launcher:', err);
344+
});
345+
}
346+
}
342347

343-
var roktFilters = window.mParticle.Rokt.filters;
348+
function initRoktLauncher(launcher) {
349+
// Assign the launcher to a global variable for later access
350+
window.Rokt.currentLauncher = launcher;
351+
// Locally cache the launcher and filters
352+
self.launcher = launcher;
344353

345-
if (!roktFilters) {
346-
console.warn('Rokt Kit: No filters have been set.');
347-
} else {
348-
self.filters = roktFilters;
349-
if (!roktFilters.filteredUser) {
350-
console.warn(
351-
'Rokt Kit: No filtered user has been set.'
352-
);
353-
}
354-
}
354+
var roktFilters = window.mParticle.Rokt.filters;
355355

356-
// Kit must be initialized before attaching to the Rokt manager
357-
self.isInitialized = true;
358-
// Attaches the kit to the Rokt manager
359-
window.mParticle.Rokt.attachKit(self);
360-
processEventQueue();
361-
})
362-
.catch(function (err) {
363-
console.error('Error creating Rokt launcher:', err);
364-
});
356+
if (!roktFilters) {
357+
console.warn('Rokt Kit: No filters have been set.');
358+
} else {
359+
self.filters = roktFilters;
360+
if (!roktFilters.filteredUser) {
361+
console.warn('Rokt Kit: No filtered user has been set.');
362+
}
363+
}
364+
365+
// Kit must be initialized before attaching to the Rokt manager
366+
self.isInitialized = true;
367+
// Attaches the kit to the Rokt manager
368+
window.mParticle.Rokt.attachKit(self);
369+
processEventQueue();
365370
}
366371

367372
// mParticle Kit Callback Methods
@@ -429,11 +434,18 @@ var RoktKit = (function (exports) {
429434
function isKitReady() {
430435
return !!(self.isInitialized && self.launcher);
431436
}
437+
438+
function isPartnerInLocalLauncherTestGroup() {
439+
return (
440+
window.mParticle.config &&
441+
window.mParticle.config.isLocalLauncherEnabled
442+
);
443+
}
432444
};
433445

434446
function generateIntegrationName(customIntegrationName) {
435447
var coreSdkVersion = window.mParticle.getVersion();
436-
var kitVersion = "1.8.1";
448+
var kitVersion = "1.9.0";
437449
var name = 'mParticle_' + 'wsdkv_' + coreSdkVersion + '_kitv_' + kitVersion;
438450

439451
if (customIntegrationName) {

0 commit comments

Comments
 (0)