@mparticle/web-rokt-kit 1.3.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -54,29 +54,22 @@ var constructor = function () {
54
54
  _service,
55
55
  testMode,
56
56
  _trackerId,
57
- filteredUserAttributes,
58
- filteredUserIdentities,
59
- appVersion,
60
- appName,
61
- customFlags
57
+ filteredUserAttributes
62
58
  ) {
63
59
  var accountId = settings.accountId;
64
60
  self.userAttributes = filteredUserAttributes;
65
61
  self.onboardingExpProvider = settings.onboardingExpProvider;
66
62
 
67
- var integrationName =
68
- customFlags && customFlags['Rokt.integrationName'];
69
- var noFunctional = customFlags && customFlags['Rokt.noFunctional'];
70
- var noTargeting = customFlags && customFlags['Rokt.noTargeting'];
63
+ var managerOptions = window.mParticle.Rokt.managerOptions || {};
64
+ var sandbox = managerOptions.sandbox || false;
71
65
 
72
- var launcherOptions = {
73
- integrationName: generateIntegrationName(integrationName),
74
- noFunctional: noFunctional,
75
- noTargeting: noTargeting,
76
- };
66
+ var launcherOptions = window.mParticle.Rokt.launcherOptions || {};
67
+ launcherOptions.integrationName = generateIntegrationName(
68
+ launcherOptions.integrationName
69
+ );
77
70
 
78
71
  if (testMode) {
79
- attachLauncher(accountId, launcherOptions);
72
+ attachLauncher(accountId, sandbox, launcherOptions);
80
73
  return;
81
74
  }
82
75
 
@@ -97,7 +90,7 @@ var constructor = function () {
97
90
  typeof window.Rokt.createLauncher === 'function' &&
98
91
  window.Rokt.currentLauncher === undefined
99
92
  ) {
100
- attachLauncher(accountId, launcherOptions);
93
+ attachLauncher(accountId, sandbox, launcherOptions);
101
94
  } else {
102
95
  console.error(
103
96
  'Rokt object is not available after script load.'
@@ -171,7 +164,7 @@ var constructor = function () {
171
164
  attributes: selectPlacementsAttributes,
172
165
  });
173
166
 
174
- self.launcher.selectPlacements(selectPlacementsOptions);
167
+ return self.launcher.selectPlacements(selectPlacementsOptions);
175
168
  }
176
169
 
177
170
  function onUserIdentified(filteredUser) {
@@ -187,9 +180,12 @@ var constructor = function () {
187
180
  delete self.userAttributes[key];
188
181
  }
189
182
 
190
- function attachLauncher(accountId, launcherOptions) {
183
+ function attachLauncher(accountId, sandbox, launcherOptions) {
191
184
  var options = mergeObjects(
192
- { accountId: accountId },
185
+ {
186
+ accountId: accountId,
187
+ sandbox: sandbox,
188
+ },
193
189
  launcherOptions || {}
194
190
  );
195
191
 
@@ -292,7 +288,7 @@ var constructor = function () {
292
288
 
293
289
  function generateIntegrationName(customIntegrationName) {
294
290
  var coreSdkVersion = window.mParticle.getVersion();
295
- var kitVersion = "1.3.1";
291
+ var kitVersion = "1.4.0";
296
292
  var name = 'mParticle_' + 'wsdkv_' + coreSdkVersion + '_kitv_' + kitVersion;
297
293
 
298
294
  if (customIntegrationName) {
@@ -53,29 +53,22 @@ var RoktKit = (function (exports) {
53
53
  _service,
54
54
  testMode,
55
55
  _trackerId,
56
- filteredUserAttributes,
57
- filteredUserIdentities,
58
- appVersion,
59
- appName,
60
- customFlags
56
+ filteredUserAttributes
61
57
  ) {
62
58
  var accountId = settings.accountId;
63
59
  self.userAttributes = filteredUserAttributes;
64
60
  self.onboardingExpProvider = settings.onboardingExpProvider;
65
61
 
66
- var integrationName =
67
- customFlags && customFlags['Rokt.integrationName'];
68
- var noFunctional = customFlags && customFlags['Rokt.noFunctional'];
69
- var noTargeting = customFlags && customFlags['Rokt.noTargeting'];
62
+ var managerOptions = window.mParticle.Rokt.managerOptions || {};
63
+ var sandbox = managerOptions.sandbox || false;
70
64
 
71
- var launcherOptions = {
72
- integrationName: generateIntegrationName(integrationName),
73
- noFunctional: noFunctional,
74
- noTargeting: noTargeting,
75
- };
65
+ var launcherOptions = window.mParticle.Rokt.launcherOptions || {};
66
+ launcherOptions.integrationName = generateIntegrationName(
67
+ launcherOptions.integrationName
68
+ );
76
69
 
77
70
  if (testMode) {
78
- attachLauncher(accountId, launcherOptions);
71
+ attachLauncher(accountId, sandbox, launcherOptions);
79
72
  return;
80
73
  }
81
74
 
@@ -96,7 +89,7 @@ var RoktKit = (function (exports) {
96
89
  typeof window.Rokt.createLauncher === 'function' &&
97
90
  window.Rokt.currentLauncher === undefined
98
91
  ) {
99
- attachLauncher(accountId, launcherOptions);
92
+ attachLauncher(accountId, sandbox, launcherOptions);
100
93
  } else {
101
94
  console.error(
102
95
  'Rokt object is not available after script load.'
@@ -170,7 +163,7 @@ var RoktKit = (function (exports) {
170
163
  attributes: selectPlacementsAttributes,
171
164
  });
172
165
 
173
- self.launcher.selectPlacements(selectPlacementsOptions);
166
+ return self.launcher.selectPlacements(selectPlacementsOptions);
174
167
  }
175
168
 
176
169
  function onUserIdentified(filteredUser) {
@@ -186,9 +179,12 @@ var RoktKit = (function (exports) {
186
179
  delete self.userAttributes[key];
187
180
  }
188
181
 
189
- function attachLauncher(accountId, launcherOptions) {
182
+ function attachLauncher(accountId, sandbox, launcherOptions) {
190
183
  var options = mergeObjects(
191
- { accountId: accountId },
184
+ {
185
+ accountId: accountId,
186
+ sandbox: sandbox,
187
+ },
192
188
  launcherOptions || {}
193
189
  );
194
190
 
@@ -291,7 +287,7 @@ var RoktKit = (function (exports) {
291
287
 
292
288
  function generateIntegrationName(customIntegrationName) {
293
289
  var coreSdkVersion = window.mParticle.getVersion();
294
- var kitVersion = "1.3.1";
290
+ var kitVersion = "1.4.0";
295
291
  var name = 'mParticle_' + 'wsdkv_' + coreSdkVersion + '_kitv_' + kitVersion;
296
292
 
297
293
  if (customIntegrationName) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mparticle/web-rokt-kit",
3
- "version": "1.3.1",
3
+ "version": "1.4.0",
4
4
  "description": "mParticle integration kit for Rokt",
5
5
  "main": "dist/Rokt-Kit.common.js",
6
6
  "files": [