@mparticle/web-braze-kit 3.0.5 → 3.0.6

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/CHANGELOG.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  --
4
4
 
5
+ #### 3.0.5 - 2023-02-15
6
+ - refactor: Update console warning and readme to reflect new rollout plans (#19)
7
+
5
8
  #### 3.0.5 - 2022-10-20
6
9
  - docs: Update README to alert developers about v4 kit upgrade date, add console warning to current CDN users (#15)
7
10
 
package/README.md CHANGED
@@ -1,52 +1,42 @@
1
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
+ # 2/14/2023 Notice! Opt in for Breaking Changes to mParticle Web Braze Kit coming soon
5
+ mParticle's Braze Kit currently uses Braze's V3 web SDK, and Braze has made significant changes to their newest V4 web SDK. Previously, mParticle planned to release an update on 2/15/2023 for all of our CDN users which upgraded to the Brave V4 web SDK. Now, rather than migrate all CDN users to V4 at the same time, you must opt in to get the latest update. This will allow you to decide when you want to upgrade to V4 and make the appropriate code changes. Opting in to V4 will be done via a connection setting in the mParticle UI that will be available shortly.
6
6
 
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.
10
-
11
- ## Braze Web Kit Citical Updates and Timelines
7
+ For now, no code changes are needed, but if you implemented the code examples outlined in our docs and earlier communications, you can continue to use the V3 code until you opt in to V4 manually. More details on that are coming soon.
12
8
 
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.
9
+ If you self-host mParticle and the Braze Web Kit via npm, you can update sooner. Follow the instructions below for if you self-host or if you are on CDN and getting ready to opt in.
14
10
 
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.
11
+ * <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 the opt in option is available. The `braze-v4-npm-master` branch currently contains the source code for v4.X.</b>
12
+ * 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.
16
13
 
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) |
14
+ ## Braze Web Kit Citical Updates and Timelines
21
15
 
22
- ### Update to Braze SDK Version 4 from Version 3 - 10/15/2022 - 2/15/2023
16
+ Braze occasionally makes breaking changes to their SDK, so if you call Braze directly in your code, you will have to update your code to ensure your website performs as expected when updating versions of Braze.
23
17
 
24
18
  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
19
 
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/).
20
+ Customers will be able to opt in to using the latest version of Braze's Web SDK both via npm and via snippet/CDN
21
+ * 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.
22
+ * Customers who load mParticle via snippet/CDN - Opting in will be available soon via the mParticle UI in your Braze connection settings.
31
23
 
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:
24
+ Note that the following is only one example. Everywhere you manually call `appboy` needs to be updated similar to the below.
35
25
 
36
26
  * 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
27
  ```javascript
38
28
  window.appboy.display.destroyFeed();
39
29
  ```
40
30
 
41
- Step 2: Roll out code changes to be used before February 15, 2023:
31
+ Step 2: Roll out code changes to be used before you opt in to using Version 4 of the Braze Web SDK so that it works under both versions:
42
32
  ```javascript
43
33
  if (window.appboy) {
44
- window.appboy.display.destroyFeed();
45
- } else if (window.braze) {
46
- window.braze.destroyFeed();
47
- }
34
+ window.appboy.display.destroyFeed();
35
+ } else if (window.braze) {
36
+ window.braze.destroyFeed();
37
+ }
48
38
  ```
49
- 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:
39
+ Step 3: After opting in to Version 4 of the Braze Web SDK, you can simplify your code:
50
40
  ```javascript
51
41
  window.braze.destroyFeed();
52
42
  ```
@@ -305,7 +305,7 @@ window.appboy = appboy_min;
305
305
 
306
306
  var name = 'Appboy',
307
307
  moduleId = 28,
308
- version = '3.0.5',
308
+ version = '3.0.6',
309
309
  MessageType = {
310
310
  PageView: 3,
311
311
  PageEvent: 4,
@@ -729,7 +729,7 @@ var constructor = function () {
729
729
  customFlags
730
730
  ) {
731
731
  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.'
732
+ 'mParticle will soon update the Braze web kit and upgrade the Braze SDK that you are currently using from V3 to V4. This will be an opt-in update, but we recommend you opt in when the update is available 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
733
  );
734
734
  // check to see if there is a logger for backwards compatibility, and if not, mock one to avoid errors
735
735
  if (!self.logger) {
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.6",
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",