@mparticle/web-braze-kit 3.0.6 → 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 +16 -24
- package/dist/BrazeKit.common.js +15 -6
- package/package.json +2 -2
- package/CHANGELOG.md +0 -57
package/README.md
CHANGED
|
@@ -1,42 +1,33 @@
|
|
|
1
|
-

|
|
1
|
+

|
|
2
2
|
|
|
3
3
|
⚠️⚠️⚠️
|
|
4
|
-
#
|
|
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.
|
|
4
|
+
# Notice! Opt in is now available for Braze Web SDK V4 - Action Required
|
|
6
5
|
|
|
7
|
-
|
|
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.
|
|
8
7
|
|
|
9
|
-
|
|
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.
|
|
10
9
|
|
|
11
|
-
|
|
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.
|
|
13
|
-
|
|
14
|
-
## Braze Web Kit Citical Updates and Timelines
|
|
15
|
-
|
|
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.
|
|
17
|
-
|
|
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.
|
|
19
|
-
|
|
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
|
|
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.
|
|
21
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.
|
|
22
|
-
* Customers who load mParticle via snippet/CDN - Opting in
|
|
12
|
+
* Customers who load mParticle via snippet/CDN - Opting in is available via the mParticle UI in your 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.
|
|
23
15
|
|
|
24
|
-
Note that the following is only one example. Everywhere you manually call `appboy` needs to be updated similar to the below.
|
|
25
16
|
|
|
26
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:
|
|
27
18
|
```javascript
|
|
28
19
|
window.appboy.display.destroyFeed();
|
|
29
20
|
```
|
|
30
21
|
|
|
31
|
-
Step 2: Roll out code changes to be used before
|
|
22
|
+
Step 2: Roll out code changes to be used before February 15, 2023:
|
|
32
23
|
```javascript
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
24
|
+
if (window.appboy) {
|
|
25
|
+
window.appboy.display.destroyFeed();
|
|
26
|
+
} else if (window.braze) {
|
|
27
|
+
window.braze.destroyFeed();
|
|
28
|
+
}
|
|
38
29
|
```
|
|
39
|
-
Step 3: After
|
|
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:
|
|
40
31
|
```javascript
|
|
41
32
|
window.braze.destroyFeed();
|
|
42
33
|
```
|
|
@@ -54,6 +45,7 @@ The legacy @mparticle/web-appboy-kit from npm includes version 2 of the Braze We
|
|
|
54
45
|
|
|
55
46
|
|
|
56
47
|
|
|
48
|
+
|
|
57
49
|
# License
|
|
58
50
|
|
|
59
51
|
Copyright 2022 mParticle, Inc.
|
package/dist/BrazeKit.common.js
CHANGED
|
@@ -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.
|
|
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
|
|
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 ' +
|
|
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[
|
|
948
|
+
config.kits[forwarderNameWithSuffix] = {
|
|
945
949
|
constructor: constructor,
|
|
946
950
|
};
|
|
947
951
|
} else {
|
|
948
952
|
config.kits = {};
|
|
949
|
-
config.kits[
|
|
953
|
+
config.kits[forwarderNameWithSuffix] = {
|
|
950
954
|
constructor: constructor,
|
|
951
955
|
};
|
|
952
956
|
}
|
|
953
957
|
window.console.log(
|
|
954
|
-
'Successfully registered ' +
|
|
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.
|
|
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.
|
|
34
|
+
"@mparticle/web-sdk": "^2.23.0"
|
|
35
35
|
},
|
|
36
36
|
"license": "Apache-2.0"
|
|
37
37
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
## Releases
|
|
2
|
-
|
|
3
|
-
--
|
|
4
|
-
|
|
5
|
-
#### 3.0.5 - 2023-02-15
|
|
6
|
-
- refactor: Update console warning and readme to reflect new rollout plans (#19)
|
|
7
|
-
|
|
8
|
-
#### 3.0.5 - 2022-10-20
|
|
9
|
-
- docs: Update README to alert developers about v4 kit upgrade date, add console warning to current CDN users (#15)
|
|
10
|
-
|
|
11
|
-
#### 3.0.4 - 2022-09-06
|
|
12
|
-
- fix: Add Transaction Id to Purchase Commerce Events
|
|
13
|
-
|
|
14
|
-
#### 3.0.3 - 2022-08-24
|
|
15
|
-
- feat: Add logging for debugging
|
|
16
|
-
|
|
17
|
-
#### 3.0.2 - 2022-06-16
|
|
18
|
-
- fix: add register_inapp and pushPrimer variables
|
|
19
|
-
|
|
20
|
-
#### 3.0.1 - 2022-05-18
|
|
21
|
-
|
|
22
|
-
- consume initOptions customFlags - this allows a customer to pass a callback to include additional options that mParticle doesn't support in the UI
|
|
23
|
-
|
|
24
|
-
#### 3.0.0 - 2022-03-28
|
|
25
|
-
|
|
26
|
-
⚠️ **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.
|
|
27
|
-
* 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.
|
|
28
|
-
* 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:
|
|
29
|
-
* The `appboy.ab` namespace has been removed and everything lives under the `appboy` namespace now.
|
|
30
|
-
* `InAppMessage.Button` has been renamed to `InAppMessageButton`
|
|
31
|
-
* Full details can be found in the README at our [AppBoy Repo](https://github.com/mparticle-integrations/mparticle-javascript-integration-appboy#readme).
|
|
32
|
-
|
|
33
|
-
#### 2.0.7 - 2022-02-09
|
|
34
|
-
|
|
35
|
-
- Feat - add new Braze clusters
|
|
36
|
-
|
|
37
|
-
#### 2.0.6 - 2020-12-10
|
|
38
|
-
|
|
39
|
-
- Feat - Add additional Braze clusters to URL mapping table
|
|
40
|
-
|
|
41
|
-
#### 2.0.5 - 2020-06-04
|
|
42
|
-
|
|
43
|
-
- Update Braze to 2.5.2
|
|
44
|
-
|
|
45
|
-
#### 2.0.4 - 2020-02-12
|
|
46
|
-
|
|
47
|
-
- Send SKU if forwardSkuAsProductName is set
|
|
48
|
-
|
|
49
|
-
#### 2.0.2 - 2020-01-23
|
|
50
|
-
|
|
51
|
-
- Feat - Set event name sent to Braze as user provided pageName
|
|
52
|
-
|
|
53
|
-
#### 2.0.1 - 2019-12-03
|
|
54
|
-
|
|
55
|
-
- Bugfix - Respect userId choice in mParticle UI dropdown
|
|
56
|
-
- Add version number
|
|
57
|
-
- Remove isObject dependency
|