@mparticle/web-braze-kit 4.2.1 → 5.0.1
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 +9 -2
- package/dist/BrazeKit.common.js +18 -13
- package/dist/BrazeKit.esm.js +11141 -0
- package/package.json +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,8 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
--
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
-
|
|
5
|
+
## 5.0.1 - 2024-11-13
|
|
6
|
+
- ci: Add esm support [#53](https://github.com/mparticle-integrations/mparticle-javascript-integration-braze/pull/53)
|
|
7
|
+
- fix: Update package.json to support esm, define missing variable declarations [#54](https://github.com/mparticle-integrations/mparticle-javascript-integration-braze/pull/54)
|
|
8
|
+
|
|
9
|
+
## 5.0.0 - 2024-10-30
|
|
10
|
+
|
|
11
|
+
⚠️ **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.
|
|
12
|
+
- feat: Support Braze Web SDK V5 [#52)](https://github.com/mparticle-integrations/mparticle-javascript-integration-braze/pull/52)
|
|
13
|
+
* 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).
|
|
7
14
|
|
|
8
15
|
## 4.2.0 - 2024-10-24
|
|
9
16
|
|
package/dist/BrazeKit.common.js
CHANGED
|
@@ -10019,9 +10019,9 @@ window.braze = require$$0;
|
|
|
10019
10019
|
|
|
10020
10020
|
// This should remain Appboy and not Braze until the core SDK is able to parse the moduleID and not the name (go.mparticle.com/work/SQDSDKS-4655)
|
|
10021
10021
|
var name = 'Appboy',
|
|
10022
|
-
suffix = '
|
|
10022
|
+
suffix = 'v5',
|
|
10023
10023
|
moduleId = 28,
|
|
10024
|
-
version = '
|
|
10024
|
+
version = '5.0.1',
|
|
10025
10025
|
MessageType = {
|
|
10026
10026
|
PageView: 3,
|
|
10027
10027
|
PageEvent: 4,
|
|
@@ -10672,27 +10672,31 @@ var constructor = function () {
|
|
|
10672
10672
|
function primeBrazeWebPush() {
|
|
10673
10673
|
// The following code block is based on Braze's best practice for implementing
|
|
10674
10674
|
// their push primer. We only modify it to include pushPrimer and register_inapp settings.
|
|
10675
|
-
// https://www.braze.com/docs/developer_guide/platform_integration_guides/web/push_notifications/
|
|
10675
|
+
// https://www.braze.com/docs/developer_guide/platform_integration_guides/web/push_notifications/soft_push_prompt
|
|
10676
10676
|
braze.subscribeToInAppMessage(function (inAppMessage) {
|
|
10677
10677
|
var shouldDisplay = true;
|
|
10678
10678
|
var pushPrimer = false;
|
|
10679
10679
|
if (inAppMessage instanceof braze.InAppMessage) {
|
|
10680
|
-
//
|
|
10681
|
-
|
|
10682
|
-
|
|
10683
|
-
|
|
10684
|
-
if (msgId == 'push-primer') {
|
|
10680
|
+
// access the key-value pairs, defined as `extras`
|
|
10681
|
+
const keyValuePairs = inAppMessage.extras || {};
|
|
10682
|
+
// check the value of our key `msg-id` defined in the Braze dashboard
|
|
10683
|
+
if (keyValuePairs['msg-id'] === 'push-primer') {
|
|
10685
10684
|
pushPrimer = true;
|
|
10686
|
-
// We don't want to display the soft push prompt to users on browsers
|
|
10687
|
-
// has already granted/blocked permission
|
|
10685
|
+
// We don't want to display the soft push prompt to users on browsers
|
|
10686
|
+
// that don't support push, or if the user has already granted/blocked permission
|
|
10688
10687
|
if (
|
|
10689
|
-
|
|
10688
|
+
braze.isPushSupported() === false ||
|
|
10690
10689
|
braze.isPushPermissionGranted() ||
|
|
10691
10690
|
braze.isPushBlocked()
|
|
10692
10691
|
) {
|
|
10692
|
+
// do not call `showInAppMessage`
|
|
10693
10693
|
shouldDisplay = false;
|
|
10694
|
+
return;
|
|
10694
10695
|
}
|
|
10695
|
-
|
|
10696
|
+
|
|
10697
|
+
// user is eligible to receive the native prompt
|
|
10698
|
+
// register a click handler on one of the two buttons
|
|
10699
|
+
if (inAppMessage.buttons[0]) {
|
|
10696
10700
|
// Prompt the user when the first button is clicked
|
|
10697
10701
|
inAppMessage.buttons[0].subscribeToClickedEvent(
|
|
10698
10702
|
function() {
|
|
@@ -10704,6 +10708,7 @@ var constructor = function () {
|
|
|
10704
10708
|
}
|
|
10705
10709
|
|
|
10706
10710
|
// Display the message if it's a push primer message and shouldDisplay is true
|
|
10711
|
+
// If it is not a push primer, we should show the message if the setting for register_inapp === 'True'
|
|
10707
10712
|
if (
|
|
10708
10713
|
(pushPrimer && shouldDisplay) ||
|
|
10709
10714
|
(!pushPrimer && forwarderSettings.register_inapp === 'True')
|
|
@@ -10860,7 +10865,7 @@ var constructor = function () {
|
|
|
10860
10865
|
options.sessionTimeoutInSeconds =
|
|
10861
10866
|
forwarderSettings.ABKSessionTimeoutKey || 1800;
|
|
10862
10867
|
options.sdkFlavor = 'mparticle';
|
|
10863
|
-
options.
|
|
10868
|
+
options.allowUserSuppliedJavascript =
|
|
10864
10869
|
forwarderSettings.enableHtmlInAppMessages == 'True';
|
|
10865
10870
|
options.doNotLoadFontAwesome =
|
|
10866
10871
|
forwarderSettings.doNotLoadFontAwesome == 'True';
|