@mparticle/web-braze-kit 3.0.4 → 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 +57 -0
- package/README.md +35 -26
- package/dist/BrazeKit.common.js +4 -1
- package/package.json +1 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
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
|
package/README.md
CHANGED
|
@@ -1,50 +1,59 @@
|
|
|
1
1
|

|
|
2
2
|
|
|
3
3
|
⚠️⚠️⚠️
|
|
4
|
-
# Notice!
|
|
5
|
-
|
|
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
|
-
|
|
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.
|
|
8
8
|
|
|
9
|
-
|
|
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.
|
|
10
10
|
|
|
11
|
-
|
|
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.
|
|
12
13
|
|
|
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`
|
|
14
|
+
## Braze Web Kit Citical Updates and Timelines
|
|
16
15
|
|
|
17
|
-
|
|
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.
|
|
18
17
|
|
|
19
|
-
|
|
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.
|
|
20
19
|
|
|
21
|
-
|
|
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.
|
|
23
|
+
|
|
24
|
+
Note that the following is only one example. Everywhere you manually call `appboy` needs to be updated similar to the below.
|
|
25
|
+
|
|
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:
|
|
22
27
|
```javascript
|
|
23
|
-
|
|
28
|
+
window.appboy.display.destroyFeed();
|
|
24
29
|
```
|
|
25
30
|
|
|
26
|
-
Step 2:
|
|
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:
|
|
27
32
|
```javascript
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
33
|
+
if (window.appboy) {
|
|
34
|
+
window.appboy.display.destroyFeed();
|
|
35
|
+
} else if (window.braze) {
|
|
36
|
+
window.braze.destroyFeed();
|
|
37
|
+
}
|
|
34
38
|
```
|
|
35
|
-
Step 3: After
|
|
39
|
+
Step 3: After opting in to Version 4 of the Braze Web SDK, you can simplify your code:
|
|
36
40
|
```javascript
|
|
37
|
-
|
|
41
|
+
window.braze.destroyFeed();
|
|
38
42
|
```
|
|
39
43
|
|
|
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:
|
|
44
|
+
Step 4: Push Notifications via service-worker.js
|
|
45
|
+
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
46
|
|
|
44
47
|
```javascript
|
|
45
|
-
self.
|
|
48
|
+
self.imports('https://static.mparticle.com/sdk/js/braze/service-worker-4.2.0.js')
|
|
46
49
|
```
|
|
47
50
|
|
|
51
|
+
### Transition from @mparticle/web-appboy-kit to @mparticle/web-braze-kit
|
|
52
|
+
|
|
53
|
+
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.
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
48
57
|
# License
|
|
49
58
|
|
|
50
59
|
Copyright 2022 mParticle, Inc.
|
|
@@ -59,4 +68,4 @@ Unless required by applicable law or agreed to in writing, software
|
|
|
59
68
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
60
69
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
61
70
|
See the License for the specific language governing permissions and
|
|
62
|
-
limitations under the License.
|
|
71
|
+
limitations under the License.
|
package/dist/BrazeKit.common.js
CHANGED
|
@@ -305,7 +305,7 @@ window.appboy = appboy_min;
|
|
|
305
305
|
|
|
306
306
|
var name = 'Appboy',
|
|
307
307
|
moduleId = 28,
|
|
308
|
-
version = '3.0.
|
|
308
|
+
version = '3.0.6',
|
|
309
309
|
MessageType = {
|
|
310
310
|
PageView: 3,
|
|
311
311
|
PageEvent: 4,
|
|
@@ -728,6 +728,9 @@ var constructor = function () {
|
|
|
728
728
|
appName,
|
|
729
729
|
customFlags
|
|
730
730
|
) {
|
|
731
|
+
console.warn(
|
|
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
|
+
);
|
|
731
734
|
// check to see if there is a logger for backwards compatibility, and if not, mock one to avoid errors
|
|
732
735
|
if (!self.logger) {
|
|
733
736
|
// create a logger
|
package/package.json
CHANGED