@mparticle/web-braze-kit 3.0.4 → 4.0.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.
- package/CHANGELOG.md +58 -0
- package/README.md +45 -26
- package/dist/BrazeKit.common.js +513 -359
- package/package.json +5 -5
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
## Releases
|
|
2
|
+
|
|
3
|
+
--
|
|
4
|
+
|
|
5
|
+
## 4.0.0 - 2022-10-19
|
|
6
|
+
|
|
7
|
+
⚠️ **Breaking** - The mParticle web Braze kit now supports Braze's Web SDK V4.2.1.
|
|
8
|
+
* Our partner, Braze, has made 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 4.2.1. The updated mParticle Braze Web kit will be available via CDN on Feb 15, 2023 and is currently available on npm at @mparticle/web-braze-kit v4.0.0.
|
|
9
|
+
* There are lots of breaking changes, most notably Braze deprecating the entire `appboy` namespace in favor of `braze`, so please proceed with caution when updating to v4.0.0 via NPM. If you implement mParticle via snippet, you will have to make changes to your codebase before Feb 15, 2023 to be compatible with both version 3 and version 4 of the Braze SDK to ensure your code continues to work.
|
|
10
|
+
* Full details about the changes and recommended code changes can be found on mParticle's [Braze integration docs page](https://docs.mparticle.com/integrations/braze/event).
|
|
11
|
+
|
|
12
|
+
#### 3.0.4 - 2022-09-06
|
|
13
|
+
- fix: Add Transaction Id to Purchase Commerce Events
|
|
14
|
+
|
|
15
|
+
#### 3.0.3 - 2022-08-24
|
|
16
|
+
- feat: Add logging for debugging
|
|
17
|
+
|
|
18
|
+
#### 3.0.2 - 2022-06-16
|
|
19
|
+
- fix: add register_inapp and pushPrimer variables
|
|
20
|
+
|
|
21
|
+
#### 3.0.1 - 2022-05-18
|
|
22
|
+
|
|
23
|
+
- consume initOptions customFlags - this allows a customer to pass a callback to include additional options that mParticle doesn't support in the UI
|
|
24
|
+
|
|
25
|
+
#### 3.0.0 - 2022-03-28
|
|
26
|
+
|
|
27
|
+
⚠️ **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.
|
|
28
|
+
* 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.
|
|
29
|
+
* 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:
|
|
30
|
+
* The `appboy.ab` namespace has been removed and everything lives under the `appboy` namespace now.
|
|
31
|
+
* `InAppMessage.Button` has been renamed to `InAppMessageButton`
|
|
32
|
+
* Full details can be found in the README at our [AppBoy Repo](https://github.com/mparticle-integrations/mparticle-javascript-integration-appboy#readme).
|
|
33
|
+
|
|
34
|
+
#### 2.0.7 - 2022-02-09
|
|
35
|
+
|
|
36
|
+
- Feat - add new Braze clusters
|
|
37
|
+
|
|
38
|
+
#### 2.0.6 - 2020-12-10
|
|
39
|
+
|
|
40
|
+
- Feat - Add additional Braze clusters to URL mapping table
|
|
41
|
+
|
|
42
|
+
#### 2.0.5 - 2020-06-04
|
|
43
|
+
|
|
44
|
+
- Update Braze to 2.5.2
|
|
45
|
+
|
|
46
|
+
#### 2.0.4 - 2020-02-12
|
|
47
|
+
|
|
48
|
+
- Send SKU if forwardSkuAsProductName is set
|
|
49
|
+
|
|
50
|
+
#### 2.0.2 - 2020-01-23
|
|
51
|
+
|
|
52
|
+
- Feat - Set event name sent to Braze as user provided pageName
|
|
53
|
+
|
|
54
|
+
#### 2.0.1 - 2019-12-03
|
|
55
|
+
|
|
56
|
+
- Bugfix - Respect userId choice in mParticle UI dropdown
|
|
57
|
+
- Add version number
|
|
58
|
+
- Remove isObject dependency
|
package/README.md
CHANGED
|
@@ -1,50 +1,69 @@
|
|
|
1
|
-

|
|
1
|
+

|
|
2
2
|
|
|
3
3
|
⚠️⚠️⚠️
|
|
4
|
-
# Notice! Timeline for Breaking Changes for mParticle Web Braze Kit-
|
|
5
|
-
|
|
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.
|
|
6
6
|
|
|
7
|
-
Braze has breaking changes
|
|
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.
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
## Braze Web Kit Citical Updates and Timelines
|
|
10
12
|
|
|
11
|
-
|
|
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.
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
* The `appboy.ab` namespace has been removed and everything lives under the `appboy` namespace now.
|
|
15
|
-
* `InAppMessage.Button` has been renamed to `InAppMessageButton`
|
|
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.
|
|
16
16
|
|
|
17
|
-
|
|
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) |
|
|
18
21
|
|
|
19
|
-
|
|
22
|
+
### Update to Braze SDK Version 4 from Version 3 - 10/15/2022 - 2/15/2023
|
|
20
23
|
|
|
21
|
-
|
|
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
|
+
|
|
36
|
+
* 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:
|
|
22
37
|
```javascript
|
|
23
|
-
|
|
38
|
+
window.appboy.display.destroyFeed();
|
|
24
39
|
```
|
|
25
40
|
|
|
26
|
-
Step 2:
|
|
41
|
+
Step 2: Roll out code changes to be used before February 15, 2023:
|
|
27
42
|
```javascript
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
banner = new appboy.Banner(‘test’);
|
|
43
|
+
if (window.appboy) {
|
|
44
|
+
window.appboy.display.destroyFeed();
|
|
45
|
+
} else if (window.braze) {
|
|
46
|
+
window.braze.destroyFeed();
|
|
33
47
|
}
|
|
34
48
|
```
|
|
35
|
-
Step 3: After
|
|
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:
|
|
36
50
|
```javascript
|
|
37
|
-
|
|
51
|
+
window.braze.destroyFeed();
|
|
38
52
|
```
|
|
39
53
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
Additionally, if you are using 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 to ensure future compatibility. In your `service-worker.js` file, update the code to reference `https://static.mparticle.com/sdk/js/braze/service-worker-3.5.0.js` instead of `https://static.mparticle.com/sdk/js/braze/service-worker.js`, ie:
|
|
54
|
+
Step 4: Push Notifications via service-worker.js
|
|
55
|
+
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:
|
|
43
56
|
|
|
44
57
|
```javascript
|
|
45
|
-
self.
|
|
58
|
+
self.imports('https://static.mparticle.com/sdk/js/braze/service-worker-4.2.0.js')
|
|
46
59
|
```
|
|
47
60
|
|
|
61
|
+
### Transition from @mparticle/web-appboy-kit to @mparticle/web-braze-kit
|
|
62
|
+
|
|
63
|
+
The legacy @mparticle/web-appboy-kit from npm includes version 2 of the Braze Web SDK. As part of this update, we've created a new [Braze web kit repo](https://github.com/mparticle-integrations/mparticle-javascript-integration-braze) to replace our deprecated [Appboy web kit repo](https://github.com/mparticle-integrations/mparticle-javascript-integration-appboy). If you are still using `@mparticle/web-appboy-kit`, you will need to consider the breaking changes Braze made between V2 and V3 of the Braze SDK (found [here](https://www.braze.com/docs/developer_guide/platform_integration_guides/web/changelog/#300)) as well as the instructions above to get from V2 to V4 of the Braze SDK.
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
48
67
|
# License
|
|
49
68
|
|
|
50
69
|
Copyright 2022 mParticle, Inc.
|
|
@@ -59,4 +78,4 @@ Unless required by applicable law or agreed to in writing, software
|
|
|
59
78
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
60
79
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
61
80
|
See the License for the specific language governing permissions and
|
|
62
|
-
limitations under the License.
|
|
81
|
+
limitations under the License.
|