@mparticle/web-braze-kit 4.1.0 → 4.1.2

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.
package/README.md CHANGED
@@ -19,7 +19,7 @@ Note that the following is only one example. Everywhere you manually call `appb
19
19
  window.appboy.display.destroyFeed();
20
20
  ```
21
21
 
22
- Step 2: Roll out code changes to be used before February 15, 2023:
22
+ Step 2: Roll out code changes prior to opting in to V4
23
23
  ```javascript
24
24
  if (window.appboy) {
25
25
  window.appboy.display.destroyFeed();
@@ -27,12 +27,14 @@ if (window.appboy) {
27
27
  window.braze.destroyFeed();
28
28
  }
29
29
  ```
30
- Step 3: After February 1, 2023, you can simplify your code after the mParticle Braze Web kit, which includes Braze SDK V4, has been released to our CDN:
30
+ Step 3: Opt into Version 4. Simply navigate to your connection settings and selection `Version 4` from the new Braze Web SDK Version drop down.
31
+
32
+ Step 4: After you opt in, you can simplify your code. We recommend testing and waiting at least 24 hours between opting in and removing previous instances of `appboy` and doing thorough testing of your application in a development environment to ensure everything is working:
31
33
  ```javascript
32
34
  window.braze.destroyFeed();
33
35
  ```
34
36
 
35
- Step 4: Push Notifications via service-worker.js
37
+ Step 5: Push Notifications via service-worker.js
36
38
  If you use Push Notifications, we have updated the `service-worker.js` file. In our testing, Braze’s push notifications work as expected regardless of what version of the service-worker is used, but we recommend updating this file to ensure future compatibility. In your `service-worker.js` file, update the code to reference `https://static.mparticle.com/sdk/js/braze/service-worker-4.2.0.js` instead of `https://static.mparticle.com/sdk/js/braze/service-worker-3.5.0.js`. Your `service-worker.js` file should now contain:
37
39
 
38
40
  ```javascript
@@ -9172,7 +9172,7 @@ window.braze = require$$0;
9172
9172
  var name = 'Appboy',
9173
9173
  suffix = 'v4',
9174
9174
  moduleId = 28,
9175
- version = '4.1.0',
9175
+ version = '4.1.2',
9176
9176
  MessageType = {
9177
9177
  PageView: 3,
9178
9178
  PageEvent: 4,
@@ -9583,9 +9583,26 @@ var constructor = function () {
9583
9583
  );
9584
9584
  }
9585
9585
  var transactionId = mpEvent.ProductAction.TransactionId;
9586
+ var totalAmount = mpEvent.ProductAction.TotalAmount;
9587
+ var taxAmount = mpEvent.ProductAction.TaxAmount;
9588
+ var shippingAmount = mpEvent.ProductAction.ShippingAmount;
9589
+ var affiliation = mpEvent.ProductAction.Affiliation;
9590
+
9586
9591
  if (transactionId) {
9587
9592
  commerceEventAttrs['Transaction Id'] = transactionId;
9588
9593
  }
9594
+ if (totalAmount) {
9595
+ commerceEventAttrs['Total Amount'] = totalAmount;
9596
+ }
9597
+ if (taxAmount) {
9598
+ commerceEventAttrs['Tax Amount'] = taxAmount;
9599
+ }
9600
+ if (shippingAmount) {
9601
+ commerceEventAttrs['Shipping Amount'] = shippingAmount;
9602
+ }
9603
+ if (affiliation) {
9604
+ commerceEventAttrs['Affiliation'] = affiliation;
9605
+ }
9589
9606
  }
9590
9607
 
9591
9608
  var sanitizedProperties = getSanitizedCustomProperties(
@@ -9912,6 +9929,11 @@ var constructor = function () {
9912
9929
  function finishBrazeInitialization(forwarderSettings) {
9913
9930
  braze.addSdkMetadata(['mp']);
9914
9931
  primeBrazeWebPush();
9932
+
9933
+ if (forwarderSettings.userIdentificationType === 'MPID' && mParticle.Identity != null && mParticle.Identity.getCurrentUser().getMPID() != null) {
9934
+ onUserIdentified(mParticle.Identity.getCurrentUser());
9935
+ }
9936
+
9915
9937
  openSession(forwarderSettings);
9916
9938
  }
9917
9939
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mparticle/web-braze-kit",
3
- "version": "4.1.0",
3
+ "version": "4.1.2",
4
4
  "author": "mParticle Developers <developers@mparticle.com> (https://www.mparticle.com)",
5
5
  "description": "mParticle integration sdk for Braze",
6
6
  "main": "dist/BrazeKit.common.js",