@braze/web-sdk 4.10.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/index.d.ts +26 -111
- package/package.json +1 -1
- package/shared-lib/braze-shared-lib.js +8 -1
- package/shared-lib/encoding-utils.js +12 -1
- package/shared-lib/event-types.js +34 -1
- package/shared-lib/guid.js +10 -1
- package/shared-lib/indexed-db-adapter.js +352 -1
- package/shared-lib/logger.js +38 -1
- package/shared-lib/supported-options.js +26 -1
- package/shared-lib/types.js +1 -1
- package/src/Card/card-manager-factory.js +14 -1
- package/src/Card/card-manager.js +78 -1
- package/src/Card/display/card-display.js +138 -1
- package/src/Card/index.js +6 -1
- package/src/Card/log-card-click.js +11 -1
- package/src/Card/log-card-dismissal.js +11 -1
- package/src/Card/log-card-impressions.js +13 -1
- package/src/Card/log-content-card-click.js +4 -1
- package/src/Card/log-content-card-impressions.js +4 -1
- package/src/Card/models/captioned-image.js +33 -1
- package/src/Card/models/card.js +197 -1
- package/src/Card/models/classic-card.js +32 -1
- package/src/Card/models/control-card.js +23 -1
- package/src/Card/models/image-only.js +31 -1
- package/src/Card/models/index.js +5 -1
- package/src/Card/types.js +1 -1
- package/src/Card/util/card-factory.js +104 -1
- package/src/ContentCards/content-cards-provider-factory.js +20 -1
- package/src/ContentCards/content-cards-provider.js +391 -1
- package/src/ContentCards/content-cards.js +24 -1
- package/src/ContentCards/get-cached-content-cards.js +5 -1
- package/src/ContentCards/index.js +7 -1
- package/src/ContentCards/request-content-cards-refresh.js +5 -1
- package/src/ContentCards/subscribe-to-content-cards-updates.js +17 -1
- package/src/ContentCards/types.js +1 -1
- package/src/ContentCards/ui/hide-content-cards.js +8 -1
- package/src/ContentCards/ui/show-content-cards.js +77 -1
- package/src/ContentCards/ui/toggle-content-cards.js +8 -1
- package/src/Core/add-sdk-metadata.js +26 -1
- package/src/Core/braze-sdk-metadata.js +10 -1
- package/src/Core/change-user.js +17 -1
- package/src/Core/destroy.js +5 -1
- package/src/Core/device-properties.js +9 -1
- package/src/Core/disable-sdk.js +15 -1
- package/src/Core/enable-sdk.js +11 -1
- package/src/Core/get-device-id.js +13 -1
- package/src/Core/get-user.js +4 -1
- package/src/Core/handle-braze-action.js +87 -1
- package/src/Core/index.js +23 -1
- package/src/Core/initialize.js +4 -1
- package/src/Core/is-disabled.js +4 -1
- package/src/Core/log-custom-event.js +38 -1
- package/src/Core/log-purchase.js +245 -1
- package/src/Core/open-session.js +25 -1
- package/src/Core/remove-all-subscriptions.js +4 -1
- package/src/Core/remove-subscription.js +4 -1
- package/src/Core/request-immediate-data-flush.js +6 -1
- package/src/Core/set-logger.js +4 -1
- package/src/Core/set-sdk-authentication-signature.js +8 -1
- package/src/Core/subscribe-to-sdk-authentication-failures.js +6 -1
- package/src/Core/toggle-logging.js +4 -1
- package/src/Core/types.js +1 -1
- package/src/Core/wipe-data.js +16 -1
- package/src/FeatureFlags/feature-flag-factory.js +24 -1
- package/src/FeatureFlags/feature-flag.js +64 -1
- package/src/FeatureFlags/feature-flags-provider-factory.js +19 -1
- package/src/FeatureFlags/feature-flags-provider.js +145 -1
- package/src/FeatureFlags/get-all-feature-flags.js +12 -1
- package/src/FeatureFlags/get-feature-flag.js +10 -1
- package/src/FeatureFlags/index.js +6 -1
- package/src/FeatureFlags/log-feature-flag-impression.js +23 -1
- package/src/FeatureFlags/refresh-feature-flags.js +9 -1
- package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +9 -1
- package/src/FeatureFlags/types.js +1 -1
- package/src/Feed/feed-provider-factory.js +18 -1
- package/src/Feed/feed-provider.js +90 -1
- package/src/Feed/feed.js +20 -1
- package/src/Feed/get-cached-feed.js +5 -1
- package/src/Feed/index.js +8 -1
- package/src/Feed/log-feed-displayed.js +7 -1
- package/src/Feed/request-feed-refresh.js +5 -1
- package/src/Feed/subscribe-to-feed-updates.js +5 -1
- package/src/Feed/types.js +1 -1
- package/src/Feed/ui/hide-feed.js +7 -1
- package/src/Feed/ui/show-feed.js +96 -1
- package/src/Feed/ui/toggle-feed.js +8 -1
- package/src/InAppMessage/defer-in-app-message.js +13 -1
- package/src/InAppMessage/display/get-animation-effect.js +19 -1
- package/src/InAppMessage/display/html-message-to-html.js +243 -1
- package/src/InAppMessage/display/in-app-message-to-html.js +188 -1
- package/src/InAppMessage/display/modal-utils.js +73 -1
- package/src/InAppMessage/get-deferred-in-app-message.js +5 -1
- package/src/InAppMessage/in-app-message-factory.js +166 -1
- package/src/InAppMessage/in-app-message-manager-factory.js +16 -1
- package/src/InAppMessage/in-app-message-manager.js +248 -1
- package/src/InAppMessage/index.js +16 -1
- package/src/InAppMessage/log-in-app-message-button-click.js +27 -1
- package/src/InAppMessage/log-in-app-message-click.js +19 -1
- package/src/InAppMessage/log-in-app-message-html-click.js +23 -1
- package/src/InAppMessage/log-in-app-message-impression.js +13 -1
- package/src/InAppMessage/models/control-message.js +11 -1
- package/src/InAppMessage/models/full-screen-message.js +105 -1
- package/src/InAppMessage/models/html-message.js +68 -1
- package/src/InAppMessage/models/in-app-message-button.js +47 -1
- package/src/InAppMessage/models/in-app-message.js +382 -1
- package/src/InAppMessage/models/modal-message.js +101 -1
- package/src/InAppMessage/models/slide-up-message.js +84 -1
- package/src/InAppMessage/models/templated-in-app-message.js +19 -1
- package/src/InAppMessage/subscribe-to-in-app-message.js +10 -1
- package/src/InAppMessage/types.js +1 -1
- package/src/InAppMessage/ui/automatically-show-in-app-messages.js +15 -1
- package/src/InAppMessage/ui/show-in-app-message.js +181 -1
- package/src/InAppMessage/utils/in-app-message-utils.js +1 -1
- package/src/Push/index.js +5 -1
- package/src/Push/is-push-blocked.js +5 -1
- package/src/Push/is-push-permission-granted.js +5 -1
- package/src/Push/is-push-supported.js +5 -1
- package/src/Push/push-manager-factory.js +30 -1
- package/src/Push/push-manager.js +387 -1
- package/src/Push/request-push-permission.js +9 -1
- package/src/Push/types.js +1 -1
- package/src/Push/unregister-push.js +5 -1
- package/src/Push/utils/push-utils.js +36 -1
- package/src/User/index.js +1 -1
- package/src/User/types.js +1 -1
- package/src/User/user-manager.js +73 -1
- package/src/User/user.js +302 -1
- package/src/common/base-feed.js +29 -1
- package/src/common/base-provider.js +6 -1
- package/src/common/constants.js +14 -1
- package/src/common/event-logger.js +31 -1
- package/src/common/feed-display.js +210 -1
- package/src/common/translations.js +148 -1
- package/src/common/types.js +1 -1
- package/src/index.js +9 -1
- package/src/l10n/l10n-manager-factory.js +22 -1
- package/src/l10n/l10n-manager.js +25 -1
- package/src/l10n/types.js +1 -1
- package/src/managers/auth-manager.js +51 -1
- package/src/managers/braze-instance.js +322 -1
- package/src/managers/device-manager.js +85 -1
- package/src/managers/network-manager.js +256 -1
- package/src/managers/server-config-manager.js +108 -1
- package/src/managers/session-manager.js +75 -1
- package/src/managers/storage-manager-factory.js +42 -1
- package/src/managers/storage-manager.js +426 -1
- package/src/managers/subscription-manager.js +28 -1
- package/src/managers/types.js +1 -1
- package/src/models/backend-errors.js +8 -1
- package/src/models/braze-event.js +47 -1
- package/src/models/braze-sdk-metadata.js +10 -1
- package/src/models/device.js +18 -1
- package/src/models/identifier.js +19 -1
- package/src/models/push-token.js +27 -1
- package/src/models/request-result.js +8 -1
- package/src/models/server-config.js +48 -1
- package/src/models/types.js +1 -1
- package/src/request-controller.js +311 -1
- package/src/triggers/models/custom-event-data.js +14 -1
- package/src/triggers/models/custom-event-property-data.js +21 -1
- package/src/triggers/models/filter-set.js +55 -1
- package/src/triggers/models/filter.js +102 -1
- package/src/triggers/models/in-app-message-click-data.js +25 -1
- package/src/triggers/models/purchase-data.js +14 -1
- package/src/triggers/models/purchase-property-data.js +21 -1
- package/src/triggers/models/push-click-data.js +15 -1
- package/src/triggers/models/trigger-condition.js +105 -1
- package/src/triggers/models/trigger-events.js +8 -1
- package/src/triggers/models/trigger.js +122 -1
- package/src/triggers/triggers-provider-factory.js +34 -1
- package/src/triggers/triggers-provider.js +326 -1
- package/src/triggers/types.js +1 -1
- package/src/types.js +1 -1
- package/src/ui/js/attach-css.js +13 -1
- package/src/ui/js/feed-css.js +12 -1
- package/src/ui/js/iam-css.js +12 -1
- package/src/ui/js/index.js +3 -1
- package/src/ui/js/load-font-awesome.js +13 -1
- package/src/util/base-device-parser.js +14 -1
- package/src/util/braze-actions.js +84 -1
- package/src/util/browser-detector.js +84 -1
- package/src/util/client-hints-parser.js +66 -1
- package/src/util/code-utils.js +100 -1
- package/src/util/color-utils.js +29 -1
- package/src/util/component-utils.js +26 -1
- package/src/util/date-utils.js +28 -1
- package/src/util/deprecation-utils.js +5 -1
- package/src/util/device-constants.js +13 -1
- package/src/util/dom-utils.js +91 -1
- package/src/util/error-utils.js +2 -1
- package/src/util/key-codes.js +1 -1
- package/src/util/math.js +5 -1
- package/src/util/net.js +71 -1
- package/src/util/request-header-utils.js +46 -1
- package/src/util/string-utils.js +22 -1
- package/src/util/types.js +1 -1
- package/src/util/url-utils.js +20 -1
- package/src/util/user-agent-parser.js +80 -1
- package/src/util/validation-utils.js +217 -1
- package/src/util/window-utils.js +34 -1
- package/src/Card/models/banner.js +0 -1
- package/src/ContentCards/log-content-cards-displayed.js +0 -1
package/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Type definitions for @braze/web-sdk
|
|
2
|
+
* Type definitions for @braze/web-sdk v5.0.1
|
|
3
3
|
* Project: https://github.com/braze-inc/braze-web-sdk
|
|
4
4
|
* (c) Braze, Inc. 2023 - http://braze.com
|
|
5
5
|
* License available at https://github.com/braze-inc/braze-web-sdk/blob/master/LICENSE
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/* eslint-disable no-unused-vars, no-use-before-define */
|
|
9
|
-
|
|
9
|
+
|
|
10
10
|
/**
|
|
11
11
|
* Enum to represent the accepted SDK Metadata tags. See `addSdkMetadata` for more info.
|
|
12
12
|
*
|
|
@@ -126,83 +126,7 @@ export class Card {
|
|
|
126
126
|
/** Whether this card is a ControlCard. */
|
|
127
127
|
isControl: boolean;
|
|
128
128
|
|
|
129
|
-
// static fromContentCardsJson(jsonData: Record<string, unknown>): Card | undefined;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* @deprecated This class has been deprecated in favor of `ImageOnly`.
|
|
134
|
-
*/
|
|
135
|
-
export class Banner extends Card {
|
|
136
|
-
/**
|
|
137
|
-
* A card with only an image, which can be passed to `showFeed` or handled manually.
|
|
138
|
-
* Subscribe to receive new cards via `subscribeToFeedUpdates`
|
|
139
|
-
*
|
|
140
|
-
* @param id - The id of the card. This will be reported back to Braze with events for analytics purposes.
|
|
141
|
-
* @param viewed - Whether this card has been shown to the user.
|
|
142
|
-
* @param imageUrl - The url for this card's image.
|
|
143
|
-
* @param created - When this card was created.
|
|
144
|
-
* @param updated - When this card was last modified.
|
|
145
|
-
* @param categories - Purely for organization in your custom implementation, these categories can be set in
|
|
146
|
-
* the dashboard composer.
|
|
147
|
-
* @param expiresAt - When this card expires and should stop being shown to the user.
|
|
148
|
-
* @param url - A url to open when this card is clicked.
|
|
149
|
-
* @param linkText - The display text for the url.
|
|
150
|
-
* @param aspectRatio - The aspect ratio for this card's image. This field is meant to serve as a hint before
|
|
151
|
-
* image loading completes. Note that the field may not be supplied in certain circumstances.
|
|
152
|
-
* @param extras - Object of string/string key/value pairs.
|
|
153
|
-
* @param pinned - Whether to pin this card to the top of the view.
|
|
154
|
-
* @param dismissible - Whether to allow the user to dismiss this card, removing it from the view.
|
|
155
|
-
* @param clicked - Whether this card has ever been clicked on this device.
|
|
156
|
-
*/
|
|
157
|
-
constructor(
|
|
158
|
-
id?: string,
|
|
159
|
-
viewed?: boolean,
|
|
160
|
-
imageUrl?: string,
|
|
161
|
-
created?: Date,
|
|
162
|
-
updated?: Date,
|
|
163
|
-
categories?: string[],
|
|
164
|
-
expiresAt?: Date,
|
|
165
|
-
url?: string,
|
|
166
|
-
linkText?: string,
|
|
167
|
-
aspectRatio?: number,
|
|
168
|
-
extras?: Record<string, string>,
|
|
169
|
-
pinned?: boolean,
|
|
170
|
-
dismissible?: boolean,
|
|
171
|
-
clicked?: boolean,
|
|
172
|
-
);
|
|
173
|
-
|
|
174
|
-
/** The url for this card's image. */
|
|
175
|
-
imageUrl?: string;
|
|
176
|
-
|
|
177
|
-
/** When this card was created. */
|
|
178
|
-
created: Date | null;
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Purely for organization in your custom implementation, these categories can be set in
|
|
182
|
-
* the dashboard composer.
|
|
183
|
-
*/
|
|
184
|
-
categories: string[];
|
|
185
|
-
|
|
186
|
-
/** A url to open when this card is clicked. */
|
|
187
|
-
url?: string;
|
|
188
|
-
|
|
189
|
-
/** The display text for the url. */
|
|
190
|
-
linkText?: string;
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* The aspect ratio for this card's image. This field is meant to serve as a hint before image loading completes.
|
|
194
|
-
* Note that the field may not be supplied in certain circumstances.
|
|
195
|
-
* */
|
|
196
|
-
aspectRatio: number | null;
|
|
197
|
-
|
|
198
|
-
/** Whether this card has been dismissed. */
|
|
199
|
-
dismissed: boolean;
|
|
200
129
|
|
|
201
|
-
/** Whether to allow the user to dismiss this card, removing it from the view. */
|
|
202
|
-
dismissible: boolean;
|
|
203
|
-
|
|
204
|
-
/** Whether this card has ever been clicked on this device. */
|
|
205
|
-
clicked: boolean;
|
|
206
130
|
}
|
|
207
131
|
|
|
208
132
|
export class ImageOnly extends Card {
|
|
@@ -474,18 +398,18 @@ export class ControlCard extends Card {
|
|
|
474
398
|
|
|
475
399
|
export class ContentCards {
|
|
476
400
|
/**
|
|
477
|
-
* A collection of `Card` descendents (`ClassicCard`, `CaptionedImage`, `
|
|
401
|
+
* A collection of `Card` descendents (`ClassicCard`, `CaptionedImage`, `ImageOnly`).
|
|
478
402
|
* If you use Braze's UI to render content cards, you generally shouldn't need to
|
|
479
403
|
* interact with this class, but if you are building your own content cards class manually, use
|
|
480
404
|
* `getCachedContentCards` to get the most recent ContentCards object.
|
|
481
405
|
*
|
|
482
|
-
* @param cards - Array of `Card` descendents (`ClassicCard`, `CaptionedImage`, `
|
|
406
|
+
* @param cards - Array of `Card` descendents (`ClassicCard`, `CaptionedImage`, `ImageOnly`).
|
|
483
407
|
* @param lastUpdated - When this collection of cards was received from Braze servers. If null, it means the
|
|
484
408
|
* content cards are still being fetched for this user.
|
|
485
409
|
*/
|
|
486
410
|
constructor(cards: Card[], lastUpdated: Date | null);
|
|
487
411
|
|
|
488
|
-
/** Array of `Card` descendents (`ClassicCard`, `CaptionedImage`, `
|
|
412
|
+
/** Array of `Card` descendents (`ClassicCard`, `CaptionedImage`, `ImageOnly`). */
|
|
489
413
|
cards: Card[];
|
|
490
414
|
|
|
491
415
|
/**
|
|
@@ -503,19 +427,19 @@ export class ContentCards {
|
|
|
503
427
|
|
|
504
428
|
export class Feed {
|
|
505
429
|
/**
|
|
506
|
-
* A collection of `Card` descendents (`ClassicCard`, `CaptionedImage`, `
|
|
430
|
+
* A collection of `Card` descendents (`ClassicCard`, `CaptionedImage`, `ImageOnly`).
|
|
507
431
|
* Subscribe to receive feed updates via `subscribeToFeedUpdates`,
|
|
508
432
|
* or get the currently cached feed with `getCachedFeed`.
|
|
509
433
|
*
|
|
510
434
|
* @param cards - Array of `Card` descendents (`ClassicCard`, `CaptionedImage`,
|
|
511
|
-
* `
|
|
435
|
+
* `ImageOnly`). Can be passed directly to `showFeed`.
|
|
512
436
|
* @param lastUpdated - When this collection of cards was received from Braze servers. If null, it means the
|
|
513
437
|
* feed has never been fetched for this user.
|
|
514
438
|
*/
|
|
515
439
|
constructor(cards: Card[], lastUpdated: Date | null);
|
|
516
440
|
|
|
517
441
|
/**
|
|
518
|
-
* Array of `Card` descendents (`ClassicCard`, `CaptionedImage`, `
|
|
442
|
+
* Array of `Card` descendents (`ClassicCard`, `CaptionedImage`, `ImageOnly`).
|
|
519
443
|
* Can be passed directly to `showFeed`.
|
|
520
444
|
*/
|
|
521
445
|
cards: Card[];
|
|
@@ -729,7 +653,7 @@ export class InAppMessage {
|
|
|
729
653
|
*/
|
|
730
654
|
subscribeToDismissedEvent(subscriber: () => void): string | null;
|
|
731
655
|
|
|
732
|
-
|
|
656
|
+
|
|
733
657
|
}
|
|
734
658
|
|
|
735
659
|
export class FullScreenMessage extends InAppMessage {
|
|
@@ -2020,11 +1944,6 @@ export function logContentCardImpressions(contentCards: Card[]): boolean;
|
|
|
2020
1944
|
*/
|
|
2021
1945
|
export function logContentCardClick(contentCard: Card): boolean;
|
|
2022
1946
|
|
|
2023
|
-
/**
|
|
2024
|
-
* @deprecated This method has been deprecated and is currently a no-op.
|
|
2025
|
-
*/
|
|
2026
|
-
export function logContentCardsDisplayed(): boolean;
|
|
2027
|
-
|
|
2028
1947
|
/**
|
|
2029
1948
|
* Reports that the current user performed a custom named event.
|
|
2030
1949
|
*
|
|
@@ -2164,7 +2083,7 @@ export function openSession(): void;
|
|
|
2164
2083
|
* - Create a `service-worker.js` file with the content below and place it in the root directory of your website:
|
|
2165
2084
|
*
|
|
2166
2085
|
* ```
|
|
2167
|
-
* self.importScripts('https://js.appboycdn.com/web-sdk/
|
|
2086
|
+
* self.importScripts('https://js.appboycdn.com/web-sdk-develop/5.0/service-worker.js');
|
|
2168
2087
|
* ```
|
|
2169
2088
|
*
|
|
2170
2089
|
* For more details, see [Our Product Documentation](https://www.braze.com/docs/developer_guide/platform_integration_guides/web/push_notifications/integration).
|
|
@@ -2404,9 +2323,10 @@ export function handleBrazeAction(
|
|
|
2404
2323
|
* Gets a feature flag by its ID.
|
|
2405
2324
|
*
|
|
2406
2325
|
* @param id - The ID of the feature flag.
|
|
2407
|
-
* @returns - An object of type `FeatureFlag
|
|
2326
|
+
* @returns - An object of type `FeatureFlag`, if feature flag with given ID exists. The method returns null if feature flag does not exist,
|
|
2327
|
+
* or if feature flags are disabled. Returns undefined if the SDK has not been initialized.
|
|
2408
2328
|
*/
|
|
2409
|
-
export function getFeatureFlag(id: string): FeatureFlag;
|
|
2329
|
+
export function getFeatureFlag(id: string): FeatureFlag | null | undefined;
|
|
2410
2330
|
|
|
2411
2331
|
/**
|
|
2412
2332
|
* Subscribe to feature flag updates. The subscriber callback will be called whenever feature flags are updated. This method
|
|
@@ -2414,8 +2334,9 @@ export function getFeatureFlag(id: string): FeatureFlag;
|
|
|
2414
2334
|
*
|
|
2415
2335
|
* @param subscriber - The callback function to handle new feature flags. This function is always called first with the
|
|
2416
2336
|
* available cached list of `FeatureFlag` objects, and will also be called when feature flag updates are available.
|
|
2417
|
-
* If
|
|
2418
|
-
* regardless of whether new feature flags are available,
|
|
2337
|
+
* If there is a failure in receiving updates, this function will be called with the cached list of `FeatureFlag` objects.
|
|
2338
|
+
* If you want to be notified when a refresh has completed regardless of whether new feature flags are available,
|
|
2339
|
+
* you should use the `successCallback` of `refreshFeatureFlags`.
|
|
2419
2340
|
*
|
|
2420
2341
|
* @returns The identifier of the subscription created. This can be passed to `removeSubscription` to cancel the subscription.
|
|
2421
2342
|
* Returns undefined if the SDK has not been initialized.
|
|
@@ -2454,10 +2375,10 @@ export type InitializationOptions = {
|
|
|
2454
2375
|
*/
|
|
2455
2376
|
allowCrawlerActivity?: boolean;
|
|
2456
2377
|
/**
|
|
2457
|
-
* By default, the Braze Web SDK does not allow user-supplied Javascript click actions
|
|
2458
|
-
* users to run Javascript on your site.
|
|
2459
|
-
*
|
|
2460
|
-
* set to true.
|
|
2378
|
+
* By default, the Braze Web SDK does not allow user-supplied Javascript click actions or enable HTML in-app messages,
|
|
2379
|
+
* as they allow Braze dashboard users to run Javascript on your site.
|
|
2380
|
+
* To indicate that you trust the Braze dashboard users to write non-malicious
|
|
2381
|
+
* Javascript click actions, set this property to true.
|
|
2461
2382
|
*/
|
|
2462
2383
|
allowUserSuppliedJavascript?: boolean;
|
|
2463
2384
|
/**
|
|
@@ -2468,6 +2389,8 @@ export type InitializationOptions = {
|
|
|
2468
2389
|
/**
|
|
2469
2390
|
* A numerical app version value which can be used for user segmentation. This value must be sent with four fields, such as
|
|
2470
2391
|
* "1.2.3.4", otherwise it will be ignored.
|
|
2392
|
+
*
|
|
2393
|
+
* Note: `appVersion` must also be set, either with the same value or a unique name for this version.
|
|
2471
2394
|
*/
|
|
2472
2395
|
appVersionNumber?: string;
|
|
2473
2396
|
/**
|
|
@@ -2504,14 +2427,6 @@ export type InitializationOptions = {
|
|
|
2504
2427
|
* is loaded on your site - otherwise in-app messages may not render correctly.
|
|
2505
2428
|
*/
|
|
2506
2429
|
doNotLoadFontAwesome?: boolean;
|
|
2507
|
-
/**
|
|
2508
|
-
* By default, the Braze Web SDK does not enable HTML in-app messages, as they allow Braze dashboard users to run Javascript
|
|
2509
|
-
* on your site. To indicate that you trust the Braze dashboard users to write non-malicious HTML in-app messages, set this
|
|
2510
|
-
* property to true. If `allowUserSuppliedJavascript` is set to true, this option will also be set to true.
|
|
2511
|
-
*
|
|
2512
|
-
* @deprecated This initialization option is deprecated in favor of `allowUserSuppliedJavascript`.
|
|
2513
|
-
*/
|
|
2514
|
-
enableHtmlInAppMessages?: boolean;
|
|
2515
2430
|
/**
|
|
2516
2431
|
* Set to true to enable logging by default. Note that this will cause Braze to log to the javascript console, which is visible
|
|
2517
2432
|
* to all users! You should probably remove this or provide an alternate logger with `setLogger` before you release
|
|
@@ -2543,7 +2458,7 @@ export type InitializationOptions = {
|
|
|
2543
2458
|
* lifecycle of, set this option to true and the Braze SDK will not register or unregister a service worker. If you set this
|
|
2544
2459
|
* option to true, in order for push to function correctly you must register the service worker yourself BEFORE calling
|
|
2545
2460
|
* `requestPushPermission`, and ensure that it contains Braze's service worker code, either with
|
|
2546
|
-
* `self.importScripts('https://js.appboycdn.com/web-sdk/
|
|
2461
|
+
* `self.importScripts('https://js.appboycdn.com/web-sdk-develop/5.0/service-worker.js');` or by including the content
|
|
2547
2462
|
* of that file directly. When this option is true, the `serviceWorkerLocation` option is irrelevant and is ignored.
|
|
2548
2463
|
*/
|
|
2549
2464
|
manageServiceWorkerExternally?: boolean;
|
|
@@ -2596,7 +2511,7 @@ export type InitializationOptions = {
|
|
|
2596
2511
|
*/
|
|
2597
2512
|
sessionTimeoutInSeconds?: number;
|
|
2598
2513
|
};
|
|
2599
|
-
// }
|
|
2600
2514
|
|
|
2601
|
-
|
|
2602
|
-
|
|
2515
|
+
|
|
2516
|
+
|
|
2517
|
+
|
package/package.json
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
|
-
import ve from"./encoding-utils.js";
|
|
1
|
+
import ve from "./encoding-utils.js";
|
|
2
|
+
import { EventTypes as De, InternalEventTypes as Be } from "./event-types.js";
|
|
3
|
+
import Ge from "./guid.js";
|
|
4
|
+
import Oe from "./indexed-db-adapter.js";
|
|
5
|
+
import Ue from "./logger.js";
|
|
6
|
+
import ke from "./supported-options.js";
|
|
7
|
+
const r = { On: ve, q: De, Cr: Be, Z: Ge, es: Oe, ts: Oe.ep, j: Ue, Yo: ke };
|
|
8
|
+
export default r;
|
|
@@ -1 +1,12 @@
|
|
|
1
|
-
const ve
|
|
1
|
+
const ve = {
|
|
2
|
+
Fn: function (t) {
|
|
3
|
+
const r = (t + "=".repeat((4 - (t.length % 4)) % 4))
|
|
4
|
+
.replace(/\-/g, "+")
|
|
5
|
+
.replace(/_/g, "/"),
|
|
6
|
+
n = atob(r),
|
|
7
|
+
o = new Uint8Array(n.length);
|
|
8
|
+
for (let t = 0; t < n.length; ++t) o[t] = n.charCodeAt(t);
|
|
9
|
+
return o;
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
export default ve;
|
|
@@ -1 +1,34 @@
|
|
|
1
|
-
const De={
|
|
1
|
+
const De = {
|
|
2
|
+
CustomEvent: "ce",
|
|
3
|
+
Pr: "p",
|
|
4
|
+
Mu: "pc",
|
|
5
|
+
cc: "ca",
|
|
6
|
+
Ka: "i",
|
|
7
|
+
qs: "ie",
|
|
8
|
+
P: "cci",
|
|
9
|
+
T: "ccic",
|
|
10
|
+
$: "ccc",
|
|
11
|
+
H: "ccd",
|
|
12
|
+
Wl: "ss",
|
|
13
|
+
xl: "se",
|
|
14
|
+
Vi: "si",
|
|
15
|
+
Li: "sc",
|
|
16
|
+
Qi: "sbc",
|
|
17
|
+
Ki: "sfe",
|
|
18
|
+
eo: "iec",
|
|
19
|
+
Lu: "lr",
|
|
20
|
+
Tu: "uae",
|
|
21
|
+
R: "ci",
|
|
22
|
+
B: "cc",
|
|
23
|
+
Ru: "lcaa",
|
|
24
|
+
Pu: "lcar",
|
|
25
|
+
Xn: "inc",
|
|
26
|
+
Jn: "add",
|
|
27
|
+
Qn: "rem",
|
|
28
|
+
Hn: "set",
|
|
29
|
+
Kn: "ncam",
|
|
30
|
+
Nu: "sgu",
|
|
31
|
+
Fr: "ffi",
|
|
32
|
+
},
|
|
33
|
+
Be = { Br: "feed_displayed", dc: "content_cards_displayed" };
|
|
34
|
+
export { De as EventTypes, Be as InternalEventTypes };
|
package/shared-lib/guid.js
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
|
-
const Ge=
|
|
1
|
+
const Ge = {
|
|
2
|
+
Y: function () {
|
|
3
|
+
const t = (t = !1) => {
|
|
4
|
+
const n = (Math.random().toString(16) + "000000000").substr(2, 8);
|
|
5
|
+
return t ? "-" + n.substr(0, 4) + "-" + n.substr(4, 4) : n;
|
|
6
|
+
};
|
|
7
|
+
return t() + t(!0) + t(!0) + t();
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
export default Ge;
|