@braze/web-sdk 6.5.0 → 6.6.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/index.d.ts +8 -3
- package/package.json +1 -1
- package/shared-lib/event-types.js +11 -11
- package/shared-lib/indexed-db-adapter.js +4 -4
- package/shared-lib/logger.js +2 -2
- package/shared-lib/supported-options.js +14 -13
- package/src/Core/disable-sdk.js +8 -7
- package/src/Core/enable-sdk.js +3 -3
- package/src/Core/is-disabled.js +1 -1
- package/src/DUST/dust-provider.js +100 -100
- package/src/DUST/dust-shared-worker-impl.js +12 -12
- package/src/DUST/dust-worker-bridge.js +11 -11
- package/src/DUST/subscribe-to-dust.js +5 -5
- package/src/InAppMessage/defer-in-app-message.js +1 -1
- package/src/InAppMessage/in-app-message-manager.js +68 -68
- package/src/InAppMessage/log-in-app-message-button-click.js +1 -1
- package/src/InAppMessage/log-in-app-message-click.js +1 -1
- package/src/InAppMessage/log-in-app-message-html-click.js +2 -2
- package/src/InAppMessage/log-in-app-message-impression.js +1 -1
- package/src/InAppMessage/models/full-screen-message.js +7 -7
- package/src/InAppMessage/models/html-message.js +8 -8
- package/src/InAppMessage/models/in-app-message-button.js +2 -2
- package/src/InAppMessage/models/in-app-message.js +42 -42
- package/src/InAppMessage/models/modal-message.js +8 -8
- package/src/InAppMessage/models/slide-up-message.js +6 -6
- package/src/InAppMessage/models/templated-in-app-message.js +8 -8
- package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
- package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
- package/src/Push/push-manager-factory.js +2 -2
- package/src/Push/utils/push-utils.js +6 -6
- package/src/User/user-manager.js +2 -2
- package/src/User/user.js +9 -9
- package/src/common/content-cards-display.js +1 -1
- package/src/l10n/l10n-manager-factory.js +1 -1
- package/src/managers/braze-instance.js +99 -95
- package/src/managers/device-manager.js +2 -2
- package/src/managers/network-manager.js +116 -116
- package/src/managers/server-config-manager.js +33 -33
- package/src/managers/session-manager.js +1 -1
- package/src/managers/storage-manager-factory.js +8 -8
- package/src/managers/storage-manager.js +45 -48
- package/src/managers/subscription-manager.js +8 -8
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +1 -1
- package/src/models/device.js +1 -1
- package/src/models/push-token.js +6 -6
- package/src/models/server-config.js +29 -29
- package/src/request-controller.js +91 -91
- package/src/triggers/models/trigger-condition.js +25 -25
- package/src/triggers/models/trigger.js +7 -7
- package/src/triggers/triggers-provider-factory.js +1 -1
- package/src/triggers/triggers-provider.js +12 -12
- package/src/ui/js/attach-css.js +1 -1
- package/src/ui/js/load-font-awesome.js +1 -1
- package/src/util/braze-actions.js +2 -2
- package/src/util/browser-detector.js +1 -1
- package/src/util/net.js +2 -2
- package/src/util/request-header-utils.js +12 -12
- package/src/util/window-utils.js +1 -1
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Type definitions for @braze/web-sdk v6.
|
|
2
|
+
* Type definitions for @braze/web-sdk v6.6.0
|
|
3
3
|
* Project: https://github.com/braze-inc/braze-web-sdk
|
|
4
4
|
* (c) Braze, Inc. 2026 - http://braze.com
|
|
5
5
|
* License available at https://github.com/braze-inc/braze-web-sdk/blob/master/LICENSE
|
|
@@ -2171,7 +2171,7 @@ export function openSession(): void;
|
|
|
2171
2171
|
* - Create a `service-worker.js` file with the content below and place it in the root directory of your website:
|
|
2172
2172
|
*
|
|
2173
2173
|
* ```
|
|
2174
|
-
* self.importScripts('https://js.appboycdn.com/web-sdk/6.
|
|
2174
|
+
* self.importScripts('https://js.appboycdn.com/web-sdk/6.6/service-worker.js');
|
|
2175
2175
|
* ```
|
|
2176
2176
|
*
|
|
2177
2177
|
* For more details, see [Our Product Documentation](https://www.braze.com/docs/developer_guide/platform_integration_guides/web/push_notifications/integration).
|
|
@@ -2594,7 +2594,7 @@ export type InitializationOptions = {
|
|
|
2594
2594
|
* lifecycle of, set this option to true and the Braze SDK will not register or unregister a service worker. If you set this
|
|
2595
2595
|
* option to true, in order for push to function correctly you must register the service worker yourself BEFORE calling
|
|
2596
2596
|
* `requestPushPermission`, and ensure that it contains Braze's service worker code, either with
|
|
2597
|
-
* `self.importScripts('https://js.appboycdn.com/web-sdk/6.
|
|
2597
|
+
* `self.importScripts('https://js.appboycdn.com/web-sdk/6.6/service-worker.js');` or by including the content
|
|
2598
2598
|
* of that file directly. When this option is true, the `serviceWorkerLocation` option is irrelevant and is ignored.
|
|
2599
2599
|
*/
|
|
2600
2600
|
manageServiceWorkerExternally?: boolean;
|
|
@@ -2604,6 +2604,11 @@ export type InitializationOptions = {
|
|
|
2604
2604
|
* value any smaller than 10 to avoid spamming the user with notifications.
|
|
2605
2605
|
*/
|
|
2606
2606
|
minimumIntervalBetweenTriggerActionsInSeconds?: number;
|
|
2607
|
+
/**
|
|
2608
|
+
* By default, Braze cookies expire after 400 days. Provide a value for this configuration option to override that
|
|
2609
|
+
* default with a value of your own.
|
|
2610
|
+
*/
|
|
2611
|
+
cookieExpiryInDays?: number;
|
|
2607
2612
|
/**
|
|
2608
2613
|
* By default, the Braze SDK will store small amounts of data (user ids, session ids), in cookies. This is done to allow Braze
|
|
2609
2614
|
* to recognize users and sessions across different subdomains of your site. If this presents a problem for you, pass `true`
|
package/package.json
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
const f = {
|
|
2
2
|
CustomEvent: "ce",
|
|
3
3
|
Pr: "p",
|
|
4
|
-
|
|
4
|
+
Sd: "pc",
|
|
5
5
|
ev: "ca",
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
Kl: "i",
|
|
7
|
+
Cl: "ie",
|
|
8
8
|
Xt: "cci",
|
|
9
9
|
Zt: "ccic",
|
|
10
10
|
Lt: "ccc",
|
|
11
11
|
Qt: "ccd",
|
|
12
12
|
Sm: "ss",
|
|
13
13
|
hm: "se",
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
zn: "si",
|
|
15
|
+
Sn: "sc",
|
|
16
|
+
Bn: "sbc",
|
|
17
17
|
tv: "sfe",
|
|
18
18
|
om: "iec",
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
jd: "lr",
|
|
20
|
+
yd: "uae",
|
|
21
|
+
$d: "lcaa",
|
|
22
|
+
Dd: "lcar",
|
|
23
23
|
Zu: "inc",
|
|
24
24
|
Qu: "add",
|
|
25
25
|
Xu: "rem",
|
|
26
26
|
Yu: "set",
|
|
27
27
|
Vu: "ncam",
|
|
28
|
-
|
|
28
|
+
qd: "sgu",
|
|
29
29
|
xo: "ffi",
|
|
30
30
|
ro: "bi",
|
|
31
31
|
ut: "bc",
|
|
@@ -307,7 +307,7 @@ export default class et {
|
|
|
307
307
|
for (const e in this.database.Fs) {
|
|
308
308
|
const n = e;
|
|
309
309
|
this.database.Fs.hasOwnProperty(e) &&
|
|
310
|
-
this.database.Fs[n] !== this.database.Fs.
|
|
310
|
+
this.database.Fs[n] !== this.database.Fs.fe &&
|
|
311
311
|
t.push(this.database.Fs[n]);
|
|
312
312
|
}
|
|
313
313
|
const e = this;
|
|
@@ -338,15 +338,15 @@ et.Us = {
|
|
|
338
338
|
Ld: "AppboyServiceWorkerAsyncStorage",
|
|
339
339
|
VERSION: 6,
|
|
340
340
|
Fs: {
|
|
341
|
-
|
|
341
|
+
_e: "data",
|
|
342
342
|
vr: "pushClicks",
|
|
343
343
|
Fu: "pushSubscribed",
|
|
344
344
|
Gd: "fallbackDevice",
|
|
345
345
|
As: "cardUpdates",
|
|
346
|
-
|
|
346
|
+
fe: "optOut",
|
|
347
347
|
zr: "pendingData",
|
|
348
348
|
qh: "sdkAuthenticationSignature",
|
|
349
349
|
},
|
|
350
|
-
|
|
350
|
+
ge: 1,
|
|
351
351
|
},
|
|
352
352
|
};
|
package/shared-lib/logger.js
CHANGED
|
@@ -24,13 +24,13 @@ const E = {
|
|
|
24
24
|
},
|
|
25
25
|
warn: function (n) {
|
|
26
26
|
if (E.zg) {
|
|
27
|
-
const o = "Braze SDK Warning: " + n + " (v6.
|
|
27
|
+
const o = "Braze SDK Warning: " + n + " (v6.6.0)";
|
|
28
28
|
null != E.Rd ? E.Rd(o) : console.warn(o);
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
error: function (n) {
|
|
32
32
|
if (E.zg) {
|
|
33
|
-
const o = "Braze SDK Error: " + n + " (v6.
|
|
33
|
+
const o = "Braze SDK Error: " + n + " (v6.6.0)";
|
|
34
34
|
null != E.Rd ? E.Rd(o) : console.error(o);
|
|
35
35
|
}
|
|
36
36
|
},
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
Ph: "allowCrawlerActivity",
|
|
3
3
|
Wh: "baseUrl",
|
|
4
|
+
le: "cookieExpiryInDays",
|
|
4
5
|
Vh: "noCookies",
|
|
5
6
|
Kh: "devicePropertyAllowlist",
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
Na: "disablePushTokenMaintenance",
|
|
8
|
+
Yh: "enableLogging",
|
|
9
|
+
$h: "enableSdkAuthentication",
|
|
10
|
+
La: "manageServiceWorkerExternally",
|
|
10
11
|
Xh: "minimumIntervalBetweenTriggerActionsInSeconds",
|
|
11
12
|
Zh: "sessionTimeoutInSeconds",
|
|
12
13
|
Qh: "appVersion",
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
Za: "appVersionNumber",
|
|
15
|
+
Ha: "serviceWorkerLocation",
|
|
16
|
+
Ka: "safariWebsitePushId",
|
|
17
|
+
Xa: "localization",
|
|
17
18
|
er: "contentSecurityNonce",
|
|
18
19
|
te: "allowUserSuppliedJavascript",
|
|
19
20
|
$a: "inAppMessageZIndex",
|
|
20
21
|
Ja: "openInAppMessagesInNewTab",
|
|
21
22
|
Oh: "requireExplicitInAppMessageDismissal",
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
tl: "doNotLoadFontAwesome",
|
|
24
|
+
il: "deviceId",
|
|
25
|
+
Ia: "serviceWorkerScope",
|
|
26
|
+
Te: "dustHost",
|
|
27
|
+
sl: "sdkFlavor",
|
|
27
28
|
tn: "openCardsInNewTab",
|
|
28
29
|
};
|
package/src/Core/disable-sdk.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import r from "../managers/braze-instance.js";
|
|
1
|
+
import r, { OPTIONS as D } from "../managers/braze-instance.js";
|
|
2
2
|
import { logger as E, IndexedDBAdapter as et } from "../../shared-lib/index.js";
|
|
3
3
|
import ee, { STORAGE_KEYS as s } from "../managers/storage-manager.js";
|
|
4
4
|
export function disableSDK() {
|
|
5
5
|
const e = r.nn();
|
|
6
6
|
e && e.requestImmediateDataFlush();
|
|
7
|
-
const n =
|
|
8
|
-
a =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
const n = r.re(D.le),
|
|
8
|
+
a = new ee.me(null, !0, n),
|
|
9
|
+
i = "This-cookie-will-expire-in-" + a.pe();
|
|
10
|
+
a.store(s.be, i);
|
|
11
|
+
const o = et.Us.Rs;
|
|
12
|
+
new et(o, E).setItem(o.Fs.fe, o.ge, !0),
|
|
12
13
|
E.info("disableSDK was called"),
|
|
13
14
|
r.destroy(!1),
|
|
14
|
-
r.
|
|
15
|
+
r.we(!0);
|
|
15
16
|
}
|
package/src/Core/enable-sdk.js
CHANGED
|
@@ -2,10 +2,10 @@ import r from "../managers/braze-instance.js";
|
|
|
2
2
|
import { logger as E, IndexedDBAdapter as et } from "../../shared-lib/index.js";
|
|
3
3
|
import ee, { STORAGE_KEYS as s } from "../managers/storage-manager.js";
|
|
4
4
|
export function enableSDK() {
|
|
5
|
-
new ee.
|
|
5
|
+
new ee.me(null, !0).remove(s.be);
|
|
6
6
|
const e = et.Us.Rs;
|
|
7
|
-
new et(e, E).je(e.Fs.
|
|
7
|
+
new et(e, E).je(e.Fs.fe, e.ge),
|
|
8
8
|
E.info("enableSDK was called"),
|
|
9
9
|
r.destroy(!1),
|
|
10
|
-
r.
|
|
10
|
+
r.we(!1);
|
|
11
11
|
}
|
package/src/Core/is-disabled.js
CHANGED