Skip to content

Commit 033b086

Browse files
feat: migrate braze-6 kit to monorepo (#1194)
* feat: migrate mparticle-javascript-integration-braze-6 to monorepo Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(ci): update braze-6 package-lock.json to resolve @braze/web-sdk@6.5.0 Lock file was out of sync — still pinned to 5.5.0 while package.json requires ^6.0.0. Regenerated with npm install --package-lock-only. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * chore: revert matrix.json to base branch (will re-add kit entry separately) * chore(matrix): add braze-6 to kit matrix * fix(braze-6): update bundle name and suffix from v5 to v6 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent b0eecec commit 033b086

14 files changed

Lines changed: 9982 additions & 0 deletions

kits/braze/braze-6/CHANGELOG.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
## Releases
2+
3+
--
4+
5+
## 5.0.3 - 2025-08-11
6+
7+
- feat: Add support to forward subscriptionGroupIds [(#57)](https://github.com/mparticle-integrations/mparticle-javascript-integration-braze/pull/57))
8+
9+
## 5.0.2 - 2025-02-27
10+
11+
- feat: Add AU Endpoint [(#56)](https://github.com/mparticle-integrations/mparticle-javascript-integration-braze/pull/56)
12+
13+
## 5.0.1 - 2024-11-13
14+
- ci: Add esm support [#53](https://github.com/mparticle-integrations/mparticle-javascript-integration-braze/pull/53)
15+
- fix: Update package.json to support esm, define missing variable declarations [#54](https://github.com/mparticle-integrations/mparticle-javascript-integration-braze/pull/54)
16+
17+
## 5.0.0 - 2024-10-30
18+
19+
⚠️ **Breaking** - The mParticle web Braze kit now supports Braze's Web SDK v5.5.0. Breaking changes cna be viewed at [Braze's changelog](https://www.braze.com/docs/developer_guide/platform_integration_guides/web/changelog/#500). There may be API changes that affect you if you call `braze` directly from your code.
20+
- feat: Support Braze Web SDK V5 [#52)](https://github.com/mparticle-integrations/mparticle-javascript-integration-braze/pull/52)
21+
* 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).
22+
23+
## 4.2.0 - 2024-10-24
24+
25+
- fix: Report purchase events to mParticle when bundling ecommerce data [#50](https://github.com/mparticle-integrations/mparticle-javascript-integration-braze/pull/50)
26+
- feat: Implement Google EU Consent [#51](https://github.com/mparticle-integrations/mparticle-javascript-integration-braze/pull/51)
27+
28+
## 4.1.5 - 2024-05-07
29+
30+
- fix: Allow any userIdentificationType to be used when initializing kit (#48)
31+
32+
## 4.1.4 - 2024-01-24
33+
34+
- fix: Forward SKU as product name when ecommerce events are bundled [#47](https://github.com/mparticle-integrations/mparticle-javascript-integration-braze/pull/47)
35+
36+
## 4.1.3 - 2023-09-25
37+
38+
- fix: Add custom logging for onUserIdentified [#42](https://github.com/mparticle-integrations/mparticle-javascript-integration-braze/pull/42))
39+
40+
## 4.1.2 - 2023-07-25
41+
42+
- fix: Set MPID before open session ([#41](https://github.com/mparticle-integrations/mparticle-javascript-integration-braze/pull/41))
43+
44+
## 4.1.1 - 2023-06-30
45+
- fix: Support bundling products, impressions, and promotions as a single event (#36)
46+
47+
## 4.1.0 - 2023-06-28
48+
- feat: Support bundling products, impressions, and promotions as a single event (#36)
49+
50+
## 4.0.2 - 2023-06-26
51+
- fix: Update @mparticle/web-sdk version in package.json
52+
- ci: Update node version (#35)
53+
- docs: Update readme to include Braze V4 SDK option (#28)
54+
55+
## 4.0.1 - 2023-06-12
56+
- fix: Add suffix of v4 to forwarder (#21)
57+
58+
## 4.0.0 - 2022-10-19
59+
60+
⚠️ **Breaking** - The mParticle web Braze kit now supports Braze's Web SDK V4.2.1.
61+
* 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.
62+
* 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.
63+
* 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).
64+
65+
#### 3.0.4 - 2022-09-06
66+
- fix: Add Transaction Id to Purchase Commerce Events
67+
68+
#### 3.0.3 - 2022-08-24
69+
- feat: Add logging for debugging
70+
71+
#### 3.0.2 - 2022-06-16
72+
- fix: add register_inapp and pushPrimer variables
73+
74+
#### 3.0.1 - 2022-05-18
75+
76+
- consume initOptions customFlags - this allows a customer to pass a callback to include additional options that mParticle doesn't support in the UI
77+
78+
#### 3.0.0 - 2022-03-28
79+
80+
⚠️ **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.
81+
* 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.
82+
* 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:
83+
* The `appboy.ab` namespace has been removed and everything lives under the `appboy` namespace now.
84+
* `InAppMessage.Button` has been renamed to `InAppMessageButton`
85+
* Full details can be found in the README at our [AppBoy Repo](https://github.com/mparticle-integrations/mparticle-javascript-integration-appboy#readme).
86+
87+
#### 2.0.7 - 2022-02-09
88+
89+
- Feat - add new Braze clusters
90+
91+
#### 2.0.6 - 2020-12-10
92+
93+
- Feat - Add additional Braze clusters to URL mapping table
94+
95+
#### 2.0.5 - 2020-06-04
96+
97+
- Update Braze to 2.5.2
98+
99+
#### 2.0.4 - 2020-02-12
100+
101+
- Send SKU if forwardSkuAsProductName is set
102+
103+
#### 2.0.2 - 2020-01-23
104+
105+
- Feat - Set event name sent to Braze as user provided pageName
106+
107+
#### 2.0.1 - 2019-12-03
108+
109+
- Bugfix - Respect userId choice in mParticle UI dropdown
110+
- Add version number
111+
- Remove isObject dependency

kits/braze/braze-6/README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
![Braze Logo](https://github.com/mparticle-integrations/mparticle-javascript-integration-appboy/blob/master/braze-logo.png)
2+
3+
⚠️⚠️⚠️
4+
# Notice! Opt in is now available for Braze Web SDK V4 - Action Required
5+
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.
7+
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.
9+
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 should add @mparticle/web-braze-kit version 4.0.0 or greater in your package.json. You must also select `Version 4` under `Braze Web SDK Version` in the Braze connection settings.
12+
* Customers who load mParticle via snippet/CDN - You must select `Version 4` under `Braze Web SDK Version` in the Braze connection settings.
13+
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.
15+
16+
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:
18+
```javascript
19+
window.appboy.display.destroyFeed();
20+
```
21+
22+
Step 2: Roll out code changes prior to opting in to V4
23+
```javascript
24+
if (window.appboy) {
25+
window.appboy.display.destroyFeed();
26+
} else if (window.braze) {
27+
window.braze.destroyFeed();
28+
}
29+
```
30+
Step 3: Whether you are using the snippet or self hosting, you need to navigate to your Braze connection settings and select `Version 4` from the `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:
33+
```javascript
34+
window.braze.destroyFeed();
35+
```
36+
37+
Step 5: Push Notifications via service-worker.js
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:
39+
40+
```javascript
41+
self.imports('https://static.mparticle.com/sdk/js/braze/service-worker-4.2.0.js')
42+
```
43+
44+
### Transition from @mparticle/web-appboy-kit to @mparticle/web-braze-kit
45+
46+
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.
47+
48+
49+
50+
51+
# License
52+
53+
Copyright 2022 mParticle, Inc.
54+
55+
Licensed under the Apache License, Version 2.0 (the "License");
56+
you may not use this file except in compliance with the License.
57+
You may obtain a copy of the License at
58+
59+
http://www.apache.org/licenses/LICENSE-2.0
60+
61+
Unless required by applicable law or agreed to in writing, software
62+
distributed under the License is distributed on an "AS IS" BASIS,
63+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
64+
See the License for the specific language governing permissions and
65+
limitations under the License.

0 commit comments

Comments
 (0)