@mparticle/web-braze-kit 3.0.5 → 3.0.8

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
@@ -1,37 +1,18 @@
1
- ![Braze Logo](https://github.com/mparticle-integrations/mparticle-javascript-integration-appboy/blob/master/braze-logo.png)
1
+ ![Braze Logo](https://github.com/mparticle-integrations/mparticle-javascript-integration-appboy/blob/master/braze-logo.png)
2
2
 
3
3
  ⚠️⚠️⚠️
4
- # Notice! Timeline for Breaking Changes for mParticle Web Braze Kit- 10/15/2022 - 2/15/2023
5
- Customers who use mParticle and Braze on their websites may require some code changes due to an update we are making to the mParticle Braze web kit. The web kit, which previously used v3.5.0 of the Braze web SDK, will use Braze SDK 4.2.1 starting on 2/15/2023 on our CDN.
4
+ # Notice! Opt in is now available for Braze Web SDK V4 - Action Required
6
5
 
7
- * <b>The Braze web SDK has several breaking changes and if you load mParticle via snippet/CDN, you should <a href="#update-to-braze-sdk-version-4-from-version-3---10152022---2152023">follow these instructions to ensure your code continues to work when our changes go live to the CDN on 2/15/2023</a>. If you self-host mParticle and the Braze Web Kit via npm, you can update sooner. Follow the instructions below whether you self-host or load mParticle via snippet/CDN.</b>.
8
- * <b>Note that if you are here looking at source code, the `master` branch will continue to contain Braze Web Kit version 3.X until 2/15/2023. The `braze-v4-npm-master` branch currently contains the source code for v4.X, and this will be merged to `master` on 2/15/2023 to be available via CDN. </b>
9
- * If you are using version 2 of the @mparticle/web-appboy-kit, you will need to <a href="#transition-from-mparticleweb-appboy-kit-to-mparticleweb-braze-kit">transition to @mparticle/web-braze-kit per the instructions here</a> before following the below instructions as well.
6
+ You can now select what version of the Braze SDK you want to use when setting up a Braze connection in the mParticle UI. Braze occasionally makes breaking changes to their SDK, so if you call `appboy` directly in your code, you will have to update your code to ensure your website performs as expected when updating versions of Braze.
10
7
 
11
- ## Braze Web Kit Citical Updates and Timelines
8
+ Please review the [Braze Changelog](https://www.braze.com/docs/developer_guide/platform_integration_guides/web/changelog#400) and [V4 migration guide](https://github.com/braze-inc/braze-web-sdk/blob/master/UPGRADE_GUIDE.md) to learn about the differences between V3 and V4 and what changes you will need to make in your code. The most significant breaking changes are the replacement of the `appboy` class name with `braze`, in addition to the removal and renaming of several APIs.
12
9
 
13
- Braze occasionally makes breaking changes to their SDK, so if you call Braze directly in your code, you may have to update your code to ensure your website performs as expected after mParticle updates to the latest Braze SDKs. This section communicates migration steps for customers to make to their codebase to ensure compatibility.
10
+ You can opt into the latest major version of the Braze Web SDK whether you implement mParticle's Web SDK using npm or our snippet/CDN.
11
+ * Customers who self-host mParticle via npm - You can use @mparticle/web-braze-kit version 4.0.0 in your package.json now! This has been available since 10/15/2022.
12
+ * Customers who load mParticle via snippet/CDN - Opting in is available via the mParticle UI in your Braze connection settings.
14
13
 
15
- Customers who implement mParticle via NPM and self-host our SDK can choose when they want to update their code and [@mParticle/web-braze-kit version](https://www.npmjs.com/package/@mparticle/web-braze-kit), but customers who implement mParticle via our snippet/CDN must pay close attention to the following timelines and instructions.
14
+ Note that the following is only one example. Everywhere you manually call `appboy` needs to be updated similar to the below. If you are using NPM, you can skip to step 3. Please be sure to test your site fully in development prior to releasing.
16
15
 
17
- | mParticle Braze Web Kit Version | Braze SDK Version Supported | Deadline/Date of CDN Release | Link to Description |
18
- | ---|---|---|---|
19
- | v4.0.0 | v4.2.1 | 2/15/2023 | [Link](#update-to-braze-sdk-version-4-from-version-3---10152022---2152023) |
20
- | v3.0.4 | v3.5.0 | NA | [Link](#transition-from-mparticleweb-appboy-kit-to-mparticleweb-braze-kit) |
21
-
22
- ### Update to Braze SDK Version 4 from Version 3 - 10/15/2022 - 2/15/2023
23
-
24
- Please review [Braze’s Changelog notes](https://www.braze.com/docs/developer_guide/platform_integration_guides/web/changelog#400) as well as Braze’s [migration guide](https://github.com/braze-inc/braze-web-sdk/blob/master/UPGRADE_GUIDE.md) between version 3 and 4 to understand these changes and what code updates are needed from your side. The largest change is the move from class name `appboy` to `braze`. Braze also removed and renamed some APIs. As a result, we are also updating our mParticle Braze web kit from 3.0.X to 4.0.X in order to support Braze’s Web SDK version 4.2.1.
25
-
26
- We plan to release the updated mParticle Braze Kit on two different time frames depending on how you load mParticle:
27
- * Customers who self-host mParticle via npm - You will be able to update manually from npm on 10/15/2022
28
- * Customers who load mParticle via snippet/CDN - We will push an update to the CDN on 2/15/2023 to make it automatically available.
29
-
30
- We want to allow our customers to take advantage of the latest from Braze, so we are releasing the kit update via npm earlier. However, due to the sensitive nature of the breaking changes in Braze’s latest version, we want to give ample notice to all of our customers who are on the CDN since these customers will get the update automatically. We want to respect the end-of-year code freezes that a lot of our customers have and allow plenty of time to make the required code changes. Striking this balance is important for us, so if you are on the CDN but need the update sooner, you can [switch to self-hosting on npm](https://docs.mparticle.com/developers/sdk/web/self-hosting/).
31
-
32
- If you load mParticle via snippet/CDN, you will have to make changes to your codebase before February 15, 2023 to be compatible with both version 3 and version 4 of the Braze SDK to ensure your code continues to work. We recommend a three-step approach. Here are some code samples of what this code could look like today (step 1), preparing for the update (step 2) and after the change is live (step 3).
33
-
34
- The following recommendations apply only to customers who load mParticle via snippet. Customers who self-host via npm can ignore step 1 and jump straight to step 3 after updating their mParticle Braze kit. Note that this is only one example. Everywhere you manually call `appboy` needs to be updated similar to the below, and please refer to the Braze Changelog and migration guide as referenced earlier:
35
16
 
36
17
  * Step 1: Legacy code sample. Find all the places where your code references the `appboy.display` namespace. Braze has removed all instances of the `display` namespace:
37
18
  ```javascript
@@ -40,8 +21,8 @@ window.appboy.display.destroyFeed();
40
21
 
41
22
  Step 2: Roll out code changes to be used before February 15, 2023:
42
23
  ```javascript
43
- if (window.appboy) {
44
- window.appboy.display.destroyFeed();
24
+ if (window.appboy) {
25
+ window.appboy.display.destroyFeed();
45
26
  } else if (window.braze) {
46
27
  window.braze.destroyFeed();
47
28
  }
@@ -64,6 +45,7 @@ The legacy @mparticle/web-appboy-kit from npm includes version 2 of the Braze We
64
45
 
65
46
 
66
47
 
48
+
67
49
  # License
68
50
 
69
51
  Copyright 2022 mParticle, Inc.
@@ -304,8 +304,9 @@ window.appboy = appboy_min;
304
304
  // limitations under the License.
305
305
 
306
306
  var name = 'Appboy',
307
+ suffix = 'v3',
307
308
  moduleId = 28,
308
- version = '3.0.5',
309
+ version = '3.0.8',
309
310
  MessageType = {
310
311
  PageView: 3,
311
312
  PageEvent: 4,
@@ -332,6 +333,7 @@ var constructor = function () {
332
333
  mpCustomFlags;
333
334
 
334
335
  self.name = name;
336
+ self.suffix = suffix;
335
337
 
336
338
  var DefaultAttributeMethods = {
337
339
  $LastName: 'setLastName',
@@ -729,7 +731,7 @@ var constructor = function () {
729
731
  customFlags
730
732
  ) {
731
733
  console.warn(
732
- 'mParticle is upgrading the Braze web kit and Braze SDK that you are currently using from V3 to V4 on 2/15/2023. You will AUTOMATICALLY receive this update if you see this message. There are many breaking changes if you invoke deprecated Braze SDK methods in your code. Please see https://docs.mparticle.com/integrations/braze/event for more information and necessary upgrade steps to take to ensure code compatibility on 2/15/2023.'
734
+ 'mParticle now supports V4 of the Braze SDK. This is an opt-in update, and we recommend you opt in to get the latest bug fixes and features from Braze. Please see https://docs.mparticle.com/integrations/braze/event for more information and necessary upgrade steps when you decide to opt in.'
733
735
  );
734
736
  // check to see if there is a logger for backwards compatibility, and if not, mock one to avoid errors
735
737
  if (!self.logger) {
@@ -926,9 +928,11 @@ function getId() {
926
928
  }
927
929
 
928
930
  function register(config) {
931
+ var forwarderNameWithSuffix = [name, suffix].join('-');
929
932
  if (!config) {
930
933
  window.console.log(
931
- 'You must pass a config object to register the kit ' + name
934
+ 'You must pass a config object to register the kit ' +
935
+ forwarderNameWithSuffix
932
936
  );
933
937
  return;
934
938
  }
@@ -941,17 +945,19 @@ function register(config) {
941
945
  }
942
946
 
943
947
  if (isObject(config.kits)) {
944
- config.kits[name] = {
948
+ config.kits[forwarderNameWithSuffix] = {
945
949
  constructor: constructor,
946
950
  };
947
951
  } else {
948
952
  config.kits = {};
949
- config.kits[name] = {
953
+ config.kits[forwarderNameWithSuffix] = {
950
954
  constructor: constructor,
951
955
  };
952
956
  }
953
957
  window.console.log(
954
- 'Successfully registered ' + name + ' to your mParticle configuration'
958
+ 'Successfully registered ' +
959
+ forwarderNameWithSuffix +
960
+ ' to your mParticle configuration'
955
961
  );
956
962
  }
957
963
 
@@ -960,6 +966,9 @@ if (window && window.mParticle && window.mParticle.addForwarder) {
960
966
  name: name,
961
967
  constructor: constructor,
962
968
  getId: getId,
969
+ // A suffix is added if there are multiple different versions of
970
+ // a client kit. This matches the suffix in the DB.
971
+ suffix: suffix,
963
972
  });
964
973
  }
965
974
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mparticle/web-braze-kit",
3
- "version": "3.0.5",
3
+ "version": "3.0.8",
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",
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@braze/web-sdk": "^3.5.0",
34
- "@mparticle/web-sdk": "^2.17.0"
34
+ "@mparticle/web-sdk": "^2.23.0"
35
35
  },
36
36
  "license": "Apache-2.0"
37
37
  }
package/CHANGELOG.md DELETED
@@ -1,54 +0,0 @@
1
- ## Releases
2
-
3
- --
4
-
5
- #### 3.0.5 - 2022-10-20
6
- - docs: Update README to alert developers about v4 kit upgrade date, add console warning to current CDN users (#15)
7
-
8
- #### 3.0.4 - 2022-09-06
9
- - fix: Add Transaction Id to Purchase Commerce Events
10
-
11
- #### 3.0.3 - 2022-08-24
12
- - feat: Add logging for debugging
13
-
14
- #### 3.0.2 - 2022-06-16
15
- - fix: add register_inapp and pushPrimer variables
16
-
17
- #### 3.0.1 - 2022-05-18
18
-
19
- - consume initOptions customFlags - this allows a customer to pass a callback to include additional options that mParticle doesn't support in the UI
20
-
21
- #### 3.0.0 - 2022-03-28
22
-
23
- ⚠️ **Breaking** - If you reference any of the below deprecations and implement mParticle via snippet, you will have to make changes to your codebase before June 8, 2022 to be compatible with both version 2 and version 3 of the Braze SDK to ensure your code continues to work.
24
- * Our partner, Braze, has made a few significant changes to their web SDK. As a result, we are also updating our mParticle Braze web kit to support Braze’s Web SDK version 3.5.0, which includes breaking changes to the Braze SDK behavior. The updated mParticle Braze Web kit will be available via CDN on June 8, 2022 and is currently available on NPM at @mparticle/web-braze-kit v3.0.0. Also note that we have updated the name of our npm package from @mparticle/web-appboy-kit to @mparticle/web-braze-kit.
25
- * We highly recommend that you review the changes between version 2 and 3 of the Braze Web SDK to understand these changes, which can be found here. To summarize:
26
- * The `appboy.ab` namespace has been removed and everything lives under the `appboy` namespace now.
27
- * `InAppMessage.Button` has been renamed to `InAppMessageButton`
28
- * Full details can be found in the README at our [AppBoy Repo](https://github.com/mparticle-integrations/mparticle-javascript-integration-appboy#readme).
29
-
30
- #### 2.0.7 - 2022-02-09
31
-
32
- - Feat - add new Braze clusters
33
-
34
- #### 2.0.6 - 2020-12-10
35
-
36
- - Feat - Add additional Braze clusters to URL mapping table
37
-
38
- #### 2.0.5 - 2020-06-04
39
-
40
- - Update Braze to 2.5.2
41
-
42
- #### 2.0.4 - 2020-02-12
43
-
44
- - Send SKU if forwardSkuAsProductName is set
45
-
46
- #### 2.0.2 - 2020-01-23
47
-
48
- - Feat - Set event name sent to Braze as user provided pageName
49
-
50
- #### 2.0.1 - 2019-12-03
51
-
52
- - Bugfix - Respect userId choice in mParticle UI dropdown
53
- - Add version number
54
- - Remove isObject dependency