@braze/web-sdk 3.2.0 → 3.5.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.
Files changed (3) hide show
  1. package/appboy.min.js +260 -246
  2. package/index.d.ts +184 -37
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
- * Type definitions for appboy-web-sdk v3.2.0
2
+ * Type definitions for appboy-web-sdk v3.5.0
3
3
  * Project: https://github.com/Appboy/appboy-web-sdk
4
- * (c) Braze, Inc. 2021 - http://braze.com
4
+ * (c) Braze, Inc. 2022 - http://braze.com
5
5
  * License available at https://github.com/Appboy/appboy-web-sdk/blob/master/LICENSE
6
6
  */
7
7
 
@@ -30,12 +30,41 @@ declare namespace appboy {
30
30
  static readonly USER_AGENT: string;
31
31
  }
32
32
 
33
+ /**
34
+ * Enum to represent the accepted SDK Metadata tags. See `appboy.addSdkMetadata` for more info.
35
+ *
36
+ * @readonly
37
+ * @enum {string}
38
+ */
39
+ class BrazeSdkMetadata {
40
+ /** Use this tag if you have integrated the Braze Web SDK using Google Tag Manager */
41
+ static readonly GOOGLE_TAG_MANAGER: string;
42
+ /** Use this tag if you have integrated the Braze Web SDK using mParticle */
43
+ static readonly MPARTICLE: string;
44
+ /** Use this tag if you have integrated the Braze Web SDK using Segment */
45
+ static readonly SEGMENT: string;
46
+ /** Use this tag if you have integrated the Braze Web SDK using Tealium */
47
+ static readonly TEALIUM: string;
48
+ /** Use this tag if you have imported the Braze Web SDK using npm */
49
+ static readonly NPM: string;
50
+ /** Use this tag if you have loaded the Braze Web SDK using Braze's CDN (js.appboycdn.com) */
51
+ static readonly CDN: string;
52
+ /** Use this tag if you have integrated or loaded the Braze Web SDK using none of the other methods */
53
+ static readonly MANUAL: string;
54
+ }
55
+
33
56
  /**
34
57
  * Abstract base for news feed cards. Use subclasses `ClassicCard`, `CaptionedImage`,
35
58
  * `Banner`, and `ControlCard`.
36
59
  */
37
60
  class Card {
38
- /** Call this method if you wish to dismiss this card programmatically. */
61
+ /**
62
+ * Call this method if you wish to programmatically remove the card from the feed and log a dismissal. This method
63
+ * is meant to be used with the Braze UI.
64
+ *
65
+ * If you are using your own UI, this method will have no effect. Instead, you should use `logCardDismissal` to
66
+ * log analytics and then remove the card from the DOM manually.
67
+ */
39
68
  dismissCard(): void;
40
69
 
41
70
  /** Remove all event subscriptions from this message. */
@@ -90,6 +119,8 @@ declare namespace appboy {
90
119
 
91
120
  /** Whether to pin this card to the top of the view. */
92
121
  pinned: boolean;
122
+
123
+ static fromContentCardsJson(jsonData: Record<string, unknown>): Card | undefined;
93
124
  }
94
125
 
95
126
  class Banner extends Card {
@@ -107,7 +138,7 @@ declare namespace appboy {
107
138
  * @param expiresAt - When this card expires and should stop being shown to the user.
108
139
  * @param url - A url to open when this card is clicked.
109
140
  * @param linkText - The display text for the url.
110
- * @param aspectRatio - The aspect ratio for this card's image.
141
+ * @param aspectRatio - The aspect ratio for this card's image. This field is meant to serve as a hint before image loading completes. Note that the field may not be supplied in certain circumstances.
111
142
  * @param extras - Object of string/string key/value pairs.
112
143
  * @param pinned - Whether to pin this card to the top of the view.
113
144
  * @param dismissible - Whether to allow the user to dismiss this card, removing it from the view.
@@ -123,7 +154,7 @@ declare namespace appboy {
123
154
  expiresAt?: Date,
124
155
  url?: string,
125
156
  linkText?: string,
126
- aspectRatio?: string,
157
+ aspectRatio?: number,
127
158
  extras?: Record<string, any>,
128
159
  pinned?: boolean,
129
160
  dismissible?: boolean,
@@ -148,8 +179,11 @@ declare namespace appboy {
148
179
  /** The display text for the url. */
149
180
  linkText?: string;
150
181
 
151
- /** The aspect ratio for this card's image. */
152
- aspectRatio: string | null;
182
+ /** The aspect ratio for this card's image. This field is meant to serve as a hint before image loading completes. Note that the field may not be supplied in certain circumstances. */
183
+ aspectRatio: number | null;
184
+
185
+ /** Whether this card has been dismissed. */
186
+ dismissed: boolean;
153
187
 
154
188
  /** Whether to allow the user to dismiss this card, removing it from the view. */
155
189
  dismissible: boolean;
@@ -175,7 +209,7 @@ declare namespace appboy {
175
209
  * @param expiresAt - When this card expires and should stop being shown to the user.
176
210
  * @param url - A url to open when this card is clicked.
177
211
  * @param linkText - The display text for the url.
178
- * @param aspectRatio - The aspect ratio for this card's image.
212
+ * @param aspectRatio - The aspect ratio for this card's image. This field is meant to serve as a hint before image loading completes. Note that the field may not be supplied in certain circumstances.
179
213
  * @param extras - Object of string/string key/value pairs.
180
214
  * @param pinned - Whether to pin this card to the top of the view.
181
215
  * @param dismissible - Whether to allow the user to dismiss this card, removing it from the view.
@@ -193,7 +227,7 @@ declare namespace appboy {
193
227
  expiresAt?: Date,
194
228
  url?: string,
195
229
  linkText?: string,
196
- aspectRatio?: string,
230
+ aspectRatio?: number,
197
231
  extras?: Record<string, any>,
198
232
  pinned?: boolean,
199
233
  dismissible?: boolean,
@@ -224,8 +258,11 @@ declare namespace appboy {
224
258
  /** The display text for the url. */
225
259
  linkText?: string;
226
260
 
227
- /** The aspect ratio for this card's image. */
228
- aspectRatio: string | null;
261
+ /** The aspect ratio for this card's image. This field is meant to serve as a hint before image loading completes. Note that the field may not be supplied in certain circumstances. */
262
+ aspectRatio: number | null;
263
+
264
+ /** Whether this card has been dismissed. */
265
+ dismissed: boolean;
229
266
 
230
267
  /** Whether to allow the user to dismiss this card, removing it from the view. */
231
268
  dismissible: boolean;
@@ -252,7 +289,7 @@ declare namespace appboy {
252
289
  * @param expiresAt - When this card expires and should stop being shown to the user.
253
290
  * @param url - A url to open when this card is clicked.
254
291
  * @param linkText - The display text for the url.
255
- * @param aspectRatio - The aspect ratio for this card's image.
292
+ * @param aspectRatio - The aspect ratio for this card's image. This field is meant to serve as a hint before image loading completes. Note that the field may not be supplied in certain circumstances.
256
293
  * @param extras - Object of string/string key/value pairs.
257
294
  * @param pinned - Whether to pin this card to the top of the view.
258
295
  * @param dismissible - Whether to allow the user to dismiss this card, removing it from the view.
@@ -270,7 +307,7 @@ declare namespace appboy {
270
307
  expiresAt?: Date,
271
308
  url?: string,
272
309
  linkText?: string,
273
- aspectRatio?: string,
310
+ aspectRatio?: number,
274
311
  extras?: Record<string, any>,
275
312
  pinned?: boolean,
276
313
  dismissible?: boolean,
@@ -301,8 +338,11 @@ declare namespace appboy {
301
338
  /** The display text for the url. */
302
339
  linkText?: string;
303
340
 
304
- /** The aspect ratio for this card's image. */
305
- aspectRatio: string | null;
341
+ /** The aspect ratio for this card's image. This field is meant to serve as a hint before image loading completes. Note that the field may not be supplied in certain circumstances. */
342
+ aspectRatio: number | null;
343
+
344
+ /** Whether this card has been dismissed. */
345
+ dismissed: boolean;
306
346
 
307
347
  /** Whether to allow the user to dismiss this card, removing it from the view. */
308
348
  dismissible: boolean;
@@ -359,6 +399,7 @@ declare namespace appboy {
359
399
 
360
400
  /**
361
401
  * Get the current unviewed card count. This is useful for powering badges on your control for showing the content cards.
402
+ * `ControlCard` cards do not count towards the unviewed count.
362
403
  */
363
404
  getUnviewedCardCount(): number;
364
405
  }
@@ -391,7 +432,8 @@ declare namespace appboy {
391
432
  /**
392
433
  * Get the current unread card count. This is useful for powering badges on your control for showing the news feed.
393
434
  * Note that Braze will not refresh news feed cards on new page loads (and so this function will return 0) until you
394
- * call `display.showFeed` or `appboy.requestFeedRefresh`.
435
+ * call `display.showFeed` or `appboy.requestFeedRefresh`. `ControlCard` cards do not count towards the
436
+ * unread count.
395
437
  */
396
438
  getUnreadCardCount(): number;
397
439
  }
@@ -434,7 +476,7 @@ declare namespace appboy {
434
476
 
435
477
  /**
436
478
  * Abstract base for in-app messages. Use subclasses `SlideUpMessage`,
437
- * `ModalMessage` and `FullScreenMessage`.
479
+ * `ModalMessage`, `FullScreenMessage`, and `HtmlMessage`.
438
480
  */
439
481
  class InAppMessage {
440
482
  static SlideFrom: {
@@ -526,7 +568,10 @@ declare namespace appboy {
526
568
  */
527
569
  css?: string;
528
570
 
529
- /** Call this method if you wish to dismiss this in-app message programmatically. */
571
+ /**
572
+ * Call this method if you wish to programmatically remove the message from the DOM. This method will only
573
+ * work with the Braze UI.
574
+ */
530
575
  closeMessage(): void;
531
576
 
532
577
  /** Remove all event subscriptions from this message. */
@@ -563,6 +608,8 @@ declare namespace appboy {
563
608
  * to cancel the subscription.
564
609
  */
565
610
  subscribeToDismissedEvent(subscriber: () => void): string;
611
+
612
+ static fromJson(jsonData: Record<string, unknown>): InAppMessage | undefined;
566
613
  }
567
614
 
568
615
  class FullScreenMessage extends InAppMessage {
@@ -1119,6 +1166,15 @@ declare namespace appboy {
1119
1166
  */
1120
1167
  addToCustomAttributeArray(key: string, value: string): boolean;
1121
1168
 
1169
+ /**
1170
+ * Adds a user to an email or SMS subscription group.
1171
+ *
1172
+ * @param subscriptionGroupId - The unique identifier of the subscription group.
1173
+ *
1174
+ * @returns Whether the update was successfully enqueued.
1175
+ */
1176
+ addToSubscriptionGroup(subscriptionGroupId: string): boolean;
1177
+
1122
1178
  /**
1123
1179
  * Asynchronously retrieves the current user's id, or null if the user is anonymous / has not been identified.
1124
1180
  * For example:
@@ -1160,6 +1216,15 @@ declare namespace appboy {
1160
1216
  */
1161
1217
  removeFromCustomAttributeArray(key: string, value: string): boolean;
1162
1218
 
1219
+ /**
1220
+ * Removes a user from an email or SMS subscription group.
1221
+ *
1222
+ * @param subscriptionGroupId - The unique identifier of the subscription group.
1223
+ *
1224
+ * @returns Whether the update was successfully enqueued.
1225
+ */
1226
+ removeFromSubscriptionGroup(subscriptionGroupId: string): boolean;
1227
+
1163
1228
  /**
1164
1229
  * Sets the url for the avatar image for the user, which will be displayed on the user profile
1165
1230
  * and throughout the Braze dashboard.
@@ -1177,7 +1242,7 @@ declare namespace appboy {
1177
1242
  *
1178
1243
  * @returns Whether the update was successfully enqueued.
1179
1244
  */
1180
- setCountry(country: string): boolean;
1245
+ setCountry(country: string | null): boolean;
1181
1246
 
1182
1247
  /**
1183
1248
  * Sets a custom user location attribute.
@@ -1434,8 +1499,8 @@ declare namespace appboy {
1434
1499
 
1435
1500
  /**
1436
1501
  * appboy.display is the public class for the UI portions of Braze's Web SDK. It is only available in
1437
- * `https://js.appboycdn.com/web-sdk-develop/3.2/appboy.min.js` and is stripped from the more minimal
1438
- * `https://js.appboycdn.com/web-sdk-develop/3.2/appboy.core.min.js`.
1502
+ * `https://js.appboycdn.com/web-sdk-develop/3.5/appboy.min.js` and is stripped from the more minimal
1503
+ * `https://js.appboycdn.com/web-sdk-develop/3.5/appboy.core.min.js`.
1439
1504
  */
1440
1505
  namespace display {
1441
1506
  /**
@@ -1591,8 +1656,12 @@ declare namespace appboy {
1591
1656
  * to target while logged out and switching back to that user ID as part of your app's logout process.
1592
1657
  *
1593
1658
  * @param userId - A unique identifier for this user. Limit 997 bytes.
1659
+ * These User IDs should be private and not easily guessable (e.g. not a plain email address or username).
1660
+ * @param signature - An encrypted signature to be used to authenticate the current user. You can update the signature
1661
+ * using the `setSdkAuthenticationSignature` method. This signature will only have an effect if the `enableSdkAuthentication`
1662
+ * initialization option is set to true.
1594
1663
  */
1595
- function changeUser(userId: string): void;
1664
+ function changeUser(userId: string, signature?: string): void;
1596
1665
 
1597
1666
  /**
1598
1667
  * Destroys this appboy instance, destroying all subscription callbacks and releasing member variables which
@@ -1728,7 +1797,7 @@ declare namespace appboy {
1728
1797
  * @returns Whether or not the event was successfully logged (to be flushed later).
1729
1798
  */
1730
1799
  function logCardImpressions(
1731
- card: appboy.Card[],
1800
+ cards: appboy.Card[],
1732
1801
  forContentCards?: boolean
1733
1802
  ): boolean;
1734
1803
 
@@ -1746,9 +1815,10 @@ declare namespace appboy {
1746
1815
  * useful for segmenting, instead of specific user actions (i.e. track watched_sports_video instead of
1747
1816
  * watched_video_adrian_peterson_td_mnf). Value is limited to 255 characters in length, cannot begin with a $,
1748
1817
  * and can only contain alphanumeric characters and punctuation.
1749
- * @param eventProperties - Hash of properties for this event. Keys are limited to 255
1750
- * characters in length, cannot begin with a $, and can only contain alphanumeric characters and punctuation.
1751
- * Values can be numeric, boolean, Date objects, or strings 255 characters or shorter.
1818
+ * @param eventProperties - Hash of properties for this event. Keys are limited to 255 characters in length, cannot begin
1819
+ * with a $, and can only contain alphanumeric characters and punctuation. Values can be numeric, boolean, Date objects,
1820
+ * strings 255 characters or shorter, or nested objects whose values can be numeric, boolean, Date objects, arrays, strings,
1821
+ * or null. Total size of event properties cannot exceed 50KB.
1752
1822
  *
1753
1823
  * @returns Whether or not the event was successfully logged (to be flushed later).
1754
1824
  */
@@ -1840,7 +1910,8 @@ declare namespace appboy {
1840
1910
  * and at most 100.
1841
1911
  * @param purchaseProperties - Hash of properties for this purchase. Keys are limited to 255
1842
1912
  * characters in length, cannot begin with a $, and can only contain alphanumeric characters and punctuation.
1843
- * Values can be numeric, boolean, Date objects, or strings 255 characters or shorter.
1913
+ * Values can be numeric, boolean, Date objects, strings 255 characters or shorter, or nested objects whose values
1914
+ * can be numeric, boolean, Date objects, arrays, strings, or null. Total size of purchase properties cannot exceed 50KB.
1844
1915
  *
1845
1916
  * @returns Whether or not the purchase was successfully attached to the session (to be flushed later).
1846
1917
  */
@@ -1871,7 +1942,7 @@ declare namespace appboy {
1871
1942
  * - Create a `service-worker.js` file with the content below and place it in the root directory of your website:
1872
1943
  *
1873
1944
  * ```
1874
- * self.importScripts('https://js.appboycdn.com/web-sdk-develop/3.2/service-worker.js');
1945
+ * self.importScripts('https://js.appboycdn.com/web-sdk-develop/3.5/service-worker.js');
1875
1946
  * ```
1876
1947
  *
1877
1948
  * For more details, see [Our Product Documentation](https://www.appboy.com/docs/developer_guide/platform_integration_guides/web/push_notifications/integration).
@@ -1908,8 +1979,13 @@ declare namespace appboy {
1908
1979
  * Requests an immediate refresh of content cards from Appboy servers. By default, content cards are refreshed when
1909
1980
  * a new session opens (see 'openSession` for more details), and when the user refreshes content cards manually via
1910
1981
  * the refresh button. If you want to refresh content cards from the server at another time you must call this function.
1982
+ *
1983
+ * @param successCallback - Callback that is invoked when the content cards refresh request has been successfully completed.
1984
+ * You should use `subscribeToContentCardsUpdates` to be notified of new cards. This callback is useful for determining when
1985
+ * a request has completed regardless of whether new cards were returned.
1986
+ * @param errorCallback - Callback that is invoked when an error occurs during the refresh.
1911
1987
  */
1912
- function requestContentCardsRefresh(): void;
1988
+ function requestContentCardsRefresh(successCallback?: () => void, errorCallback?: () => void): void;
1913
1989
 
1914
1990
  /**
1915
1991
  * Requests an immediate refresh of the news feed from Braze servers. By default, the news feed is refreshed on
@@ -1935,11 +2011,21 @@ declare namespace appboy {
1935
2011
  ): void;
1936
2012
 
1937
2013
  /**
1938
- * Removes the cookie set by `stopWebTracking`, causing subsequent calls to the Braze Web SDK to function. You must
1939
- * call `initialize` after calling this method before calling subsequent methods.
2014
+ * @deprecated This method has been deprecated in favor of `enableSDK`, which has the same functionality.
1940
2015
  */
1941
2016
  function resumeWebTracking(): void;
1942
2017
 
2018
+ /**
2019
+ * Removes the cookie set by `disableSDK`, causing subsequent calls to the Braze Web SDK to function. You must
2020
+ * call `initialize` after calling this method before calling subsequent methods.
2021
+ */
2022
+ function enableSDK(): void;
2023
+
2024
+ /**
2025
+ * Getter method to determine if the SDK is disabled based on whether the cookie set by `stopWebTracking` exists
2026
+ */
2027
+ function isDisabled(): boolean;
2028
+
1943
2029
  /**
1944
2030
  * By default, Braze logs to the browser console. Call this method to set a custom log action and enable debug-level log statements.
1945
2031
  *
@@ -1948,22 +2034,46 @@ declare namespace appboy {
1948
2034
  */
1949
2035
  function setLogger(loggerFunction: (message: string) => void): void;
1950
2036
 
2037
+ /**
2038
+ * Sets the signature to be used to authenticate the current user. You can also set the signature when calling `changeUser`.
2039
+ * This signature will only have an effect if the `enableSdkAuthentication` initialization option is set to true.
2040
+ *
2041
+ * @param signature - The signature to add to network requests to authenticate the current user.
2042
+ *
2043
+ * @returns Whether or not the signature is valid.
2044
+ */
2045
+ function setSdkAuthenticationSignature(signature: string): boolean;
2046
+
2047
+ /**
2048
+ * Adds SDK Metadata, which you can use to self-report how you load and integrate the Braze SDK.
2049
+ *
2050
+ * @param sdkMetadata - An array of metadata values from `BrazeSdkMetadata`.
2051
+ *
2052
+ * @returns Whether or not the array of metadata is valid.
2053
+ */
2054
+ function addSdkMetadata(sdkMetadata: string[]): boolean;
2055
+
2056
+ /**
2057
+ * @deprecated This method has been deprecated in favor of `disableSDK`, which has the same functionality.
2058
+ */
2059
+ function stopWebTracking(): void;
2060
+
1951
2061
  /**
1952
2062
  * Sets a cookie that causes all subsequent calls to the Braze Web SDK to be ignored
1953
2063
  * and all subsequent analytics to cease being sent to the Braze backend.
1954
2064
  * If you have multiple subdomains, this method MUST be called from the same subdomain that push was registered from to work properly.
1955
2065
  * This is useful for customer opt-outs. If the customer clears website data, tracking will resume.
1956
2066
  */
1957
- function stopWebTracking(): void;
2067
+ function disableSDK(): void;
1958
2068
 
1959
2069
  /**
1960
2070
  * Subscribe to content cards updates. The subscriber callback will be called whenever content cards are updated.
1961
2071
  *
1962
- * @param subscriber - The callback function to handle new cards. This function will be
1963
- * called with an `ContentCards` object which includes all currently available `Card` objects.
2072
+ * @param subscriber - The callback function to handle new cards. This function will be called with a `ContentCards`
2073
+ * object which includes all currently available `Card` objects. If you want to be notified when a refresh has completed
2074
+ * regardless of whether new cards are available, you should use the `successCallback` of `requestContentCardsRefresh`.
1964
2075
  *
1965
- * @returns The identifier of the subscription created. This can be passed to
1966
- * `removeSubscription` to cancel the subscription.
2076
+ * @returns The identifier of the subscription created. This can be passed to `removeSubscription` to cancel the subscription.
1967
2077
  */
1968
2078
  function subscribeToContentCardsUpdates(
1969
2079
  subscriber: (cards: appboy.ContentCards) => void
@@ -2031,6 +2141,27 @@ declare namespace appboy {
2031
2141
  ) => void
2032
2142
  ): string;
2033
2143
 
2144
+ /**
2145
+ * Subscribe to be notified of network request failures that occured due to an SDK Authentication error. This
2146
+ * method can be used to determine when to call `setSdkAuthenticationSignature` to provide the SDK with a new signature.
2147
+ * If you do not have SDK Authentication enabled on the Braze dashboard, this subscription will never be invoked.
2148
+ *
2149
+ * @param subscriber - The subscriber function that is invoked whenever an SDK Authentication error occurs. It is
2150
+ * invoked with an object containing the `errorCode`, `reason` for the error, the `userId` of the request (if the
2151
+ * user is not anonymous), and the authentication `signature` that caused the error.
2152
+ *
2153
+ * @returns The identifier of the subscription created. This can be passed to
2154
+ * 'removeSubscription` to cancel the subscription.
2155
+ */
2156
+ function subscribeToSdkAuthenticationFailures(subscriber: (
2157
+ error: {
2158
+ errorCode: string,
2159
+ reason?: string,
2160
+ userId?: string,
2161
+ signature?: string
2162
+ }
2163
+ ) => void): string;
2164
+
2034
2165
  /**
2035
2166
  * By default, Braze silences its logging to prevent spamming production js consoles. Call this method to
2036
2167
  * toggle logging.
@@ -2041,6 +2172,9 @@ declare namespace appboy {
2041
2172
  * Causes the Braze Web SDK to begin continuously collecting the user's location while your website is visible in
2042
2173
  * the foreground of their browser, for the duration of this page load. This will cause the browser to request
2043
2174
  * permission from the user if they have not already granted or denied it.
2175
+ *
2176
+ * @deprecated This method has been deprecated in favor of using the native [Geolocation API](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API)
2177
+ * and passing the location data to `User.setLastKnownLocation`.
2044
2178
  */
2045
2179
  function trackLocation(): void;
2046
2180
 
@@ -2128,6 +2262,8 @@ declare namespace appboy {
2128
2262
  * By default, the Braze Web SDK does not enable HTML in-app messages, as they allow Braze dashboard users to run Javascript
2129
2263
  * on your site. To indicate that you trust the Braze dashboard users to write non-malicious HTML in-app messages, set this
2130
2264
  * property to true. If `allowUserSuppliedJavascript` is set to true, this option will also be set to true.
2265
+ *
2266
+ * @deprecated This initialization option is deprecated in favor of `allowUserSuppliedJavascript`.
2131
2267
  */
2132
2268
  enableHtmlInAppMessages?: boolean;
2133
2269
  /**
@@ -2136,6 +2272,17 @@ declare namespace appboy {
2136
2272
  * your page to production.
2137
2273
  */
2138
2274
  enableLogging?: boolean;
2275
+ /**
2276
+ * Set to true to enable the SDK Authentication feature. For more information about SDK Authentication, see our
2277
+ * [Product Documentation](https://www.braze.com/docs/developer_guide/platform_wide/sdk_authentication/).
2278
+ */
2279
+ enableSdkAuthentication?: boolean
2280
+ /**
2281
+ * By default, the Braze SDK will show In-App Messages with a z-index of 1040 for the screen overlay, 1050 for the actual in-app message,
2282
+ * and 1060 for the message's close button. Provide a value for this option to override these default z-indexes. The value provided
2283
+ * will be used for the backdrop, `value + 1` will be used for the in-app message, and `value + 2` will be used for the close button.
2284
+ */
2285
+ inAppMessageZIndex?: number
2139
2286
  /**
2140
2287
  * By default, any SDK-generated user-visible messages will be displayed in the user's browser language. Provide a value for this
2141
2288
  * option to override that behavior and force a specific language. The value for this option should be a
@@ -2150,7 +2297,7 @@ declare namespace appboy {
2150
2297
  * lifecycle of, set this option to true and the Braze SDK will not register or unregister a service worker. If you set this
2151
2298
  * option to true, in order for push to function correctly you must register the service worker yourself BEFORE calling
2152
2299
  * `appboy.registerAppboyPushMessages`, and ensure that it contains Braze's service worker code, either with
2153
- * `self.importScripts('https://js.appboycdn.com/web-sdk-develop/3.2/service-worker.js');` or by including the content
2300
+ * `self.importScripts('https://js.appboycdn.com/web-sdk-develop/3.5/service-worker.js');` or by including the content
2154
2301
  * of that file directly. When this option is true, the `serviceWorkerLocation` option is irrelevant and is ignored.
2155
2302
  */
2156
2303
  manageServiceWorkerExternally?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@braze/web-sdk",
3
- "version": "3.2.0",
3
+ "version": "3.5.0",
4
4
  "description": "Braze SDK for web sites and other JS platforms.",
5
5
  "main": "appboy.min.js",
6
6
  "scripts": {