SDK changelog
Changelog and release notes for the Batch SDK.
Minor and patch releases are automatically rolled out to pages.
You can upgrade between major versions by changing the version of the script included in your webpage:
Look for
https://via.batch.com/v4/bootstrap.min.jsin the script tag, wherev4is the major version.Your service worker file also needs to be updated to match the tag's version, or the SDK might fail to start and/or display notifications.
4.4.0
Profile
Breaking: Added client-side 25 kB payload size validation for custom events and profile attribute updates. Payloads exceeding the limit are now rejected when using
profile.edit()ortrackEvent().String array attributes and topic preferences are now automatically deduplicated before processing.
setAttribute(array type),addToArray,removeFromArray,setTopicPreferences,addToTopicPreferences, andremoveFromTopicPreferencesnow deduplicate values, matching the behavior already applied by Batch's server and the CEP Profile API.Deduplication follows a last-wins rule: if a value already exists in the array, it is moved to the end.
Size limits are enforced after deduplication.
4.2.0
Profile
Strengthened custom user identifier validation on the
identifyAPI to avoid unintended values.Profile string attributes now support up to 300 characters for the Customer Engagement Platform (CEP). The limit for the Mobile Engagement Platform (MEP) remains 64 characters. Attributes set via
IProfileDataEditor.setAttribute()longer than 64 characters only apply to CEP.Event string attributes now support up to 300 characters for the Customer Engagement Platform (CEP). The limit for the Mobile Engagement Platform (MEP) remains 200 characters. Attributes set via
trackEventlonger than 200 characters only apply to CEP.
4.0.0
This is a major release. See the migration guide for more info on what changed since 3.x.
Core
Added built-in German translations.
Added an optional
defaultDataCollectionconfiguration object tosetup. This lets you enable the GeoIP back-end resolution for the user'sregionattribute, which is now disabled by default.Added an optional
migrationsconfiguration object tosetup. This lets you disable data migrations to the new Batch user-centric data model, which is enabled by default.
Service worker
Moved service worker configuration keys into a
serviceWorkerobject.automaticallyRegisterreplacesuseExistingServiceWorker. Set it tofalseto prevent Batch from automatically registering its worker. Default:true.waitTimeoutreplacesserviceWorkerTimeoutand works the same way.registrationlets Batch use a specific service worker registration. This can be a registration for a sub-scope that does not control the current page. Batch cannot verify that this service worker is valid for push notifications. UsingregistrationrequiresautomaticallyRegisterto befalse. If you do not set it, Batch defaults tonavigator.serviceWorker.ready.serviceWorkerPathOverridehas been removed. Manually register a service worker with your custom path and pass the promise toregistration.
User and profile
In the past, data was siloed between platforms. Projects remove that limitation by introducing profiles. Each Project is associated with a unified user base made up of profiles. When users interact with any platform in a Project, their actions feed the associated profiles.
Web SDK v4 APIs are fully compatible with profiles and let you set attributes and events on omnichannel profiles.
Removed
setCustomUserID. Useidentifyinstead.Removed
getCustomUserID. There is no equivalent.Removed
setUserLanguage. UsesetLanguageinstead.Removed
setUserRegion. UsesetRegioninstead.Removed
editUserData. Useeditinstead.Removed
IUserDataEditor. UseIProfileDataEditorinstead.Removed
addTag. UseaddToArrayinstead.Removed
removeTag. UseremoveFromArrayinstead.Updated
trackEventparameters inEventDataParams:Added support for
ArrayandObjectattribute types.Replaced the optional
tagattribute with$tagsunder theattributesobject.Replaced the optional
labelattribute with$labelunder theattributesobject.
Added the
profileAPI to access the public profile module.Added
identifyunderIBatchProfileas a replacement forsetCustomUserID.Added
editunderIBatchProfileas a replacement foreditUserData.Added
setEmailAddress. This requires a registered custom user ID.Added
setEmailMarketingSubscription.Added
setLanguageunderIProfileDataEditoras a replacement forsetUserLanguage.Added
setRegionunderIProfileDataEditoras a replacement forsetUserRegion.Added
clearInstallationDatato clear all installation-related local data without affecting profile data.
3.4.0
Core
subdomainis now optional in the configuration object. Previously, omitting it could prevent notifications from showing their icon and image or opening the website on click.
Safari
Batch now uses Web Push Protocol by default on Safari if a user is not already subscribed with APNS.
UI
The
alertUI component now supports a configurable extra button.Fixed an issue where the native UI component would not automatically resubscribe a user if the backoff duration had not elapsed.
3.3.0
Core
Added
api.refreshServiceWorkerRegistration()to resynchronize Batch's internal state with the current service worker registration.Added
api.doesExistingSubscriptionKeyMatchCurrent()to check whether the current service worker registration'sapplicationServerKeymatches the one Batch is configured with.
For more details, see the JSDoc.
User
Optimized custom data synchronization when no data has been set.
UI Components
Added the
showIfPermissionGrantedoption to the Alert format. It defaults totrue. Set it tofalseto prevent Alert from showing when the user has already granted notification permission, even if they are not subscribed to Batch. In that case, they will not be automatically resubscribed until you callapi.subscribe().
3.2.0
User
Added support for custom attributes and tags. See the attributes documentation for more info.
3.0.0 / 3.0.1
This is a major release. See the migration guide for more info on what changed since 2.x.
Core
Added support for Safari push notifications. This requires additional dashboard and SDK configuration. See Safari APNs setup for more info. Safari 12 or higher is required.
Removed support for HTTP/Multidomain mode.
sameOriginis now deprecated and should be removed from the SDK configuration.defaultIconandsmallIconare now optional and can be remotely configured from the Batch dashboard. Setting your own URLs is still supported.
UI Components
If the
defaultIconimage cannot be loaded, UI components now hide the image instead of showing the browser's broken image placeholder.
2.2.0
Minimal browser versions
Edge (Legacy): 16
Chrome: 55
Firefox: 53
Edge Chromium: 77
Core
Added
getConfiguration()to return a read-only copy of the SDK configuration for debugging.Improved logging of service worker registration errors.
Added WebP images for Firefox.
Fixed an issue where calling
setuptwice resulted in unexpected behavior.
User
Improved type checking for
setandgetmethods on user language, user region, and custom user ID:They can no longer return
undefined. They now always returnnullif not set.They accept both
nullandundefinedto unset their values.
Updated
getInstallationIDso its definition matches the fact that it can never returnnull.
UI Components
Fixed various theming issues on the
buttonformat.Added stable identifiers to multiple formats.
Added a UI component that can display public identifiers such as Installation ID and Custom User ID. Show it with
batchSDK('ui.showPublicIdentifiers').Fixed a bug on Chrome where the native notification permission popup could be displayed twice if the user dismissed it.
Messaging
Removed support for opening deeplinks in a pre-existing tab. A new tab now always opens.
2.1.0
Core
Reworked how the service worker is included. It is now automatically updated to the latest version.
Removed async
importScripts, which could cause issues in a shared service worker environment.
This release updates the service worker loader and shared worker implementation. Redownload batchsdk-worker-loader.js and deploy it to your website. If you use the shared worker, also download batchsdk-shared-worker.js and replace your existing setupSharedBatchSDK method with the new one.
If you rely on a shared service worker implementation, upgrade as soon as possible to stay compatible with recent Chrome and Firefox versions.
2.0.9
Core
Fixed an issue where the registration token would not be immediately sent to the server if the service worker had been unregistered by a third party.
Fixed an issue where calling Batch APIs before the SDK was ready could fail. Calls are now enqueued properly.
UI Components
Fixed
popintitle configuration not being honored.
2.0.8
UI Components
Improved
buttonrendering on mobile devices.Replaced header tags in UI components with simpler tags.
Fixed
bannerleft positioning.Fixed a Firefox bug where
alertmight never appear.Implemented
pushsubscriptionchangein the service worker.Lazy loaded help images for browser permission re-opt-in.
Added WebP help images for Chrome and optimized their PNG versions.
2.0.0
Added a new UI component format: Alert.
The
buttonUI component now supports configuring a preview of push notifications instead of a placeholder.The
buttonUI component now supports changing the bell hover color with thehoverForegroundColorconfiguration key.Exposed the previously undocumented
uiobject in the SDK public API.Most UI components now support the
autoShowconfiguration option, which prevents them from being shown automatically. Usage:ui: { banner: { autoShow: false } }.banner.hideFornow defaults to 7 days.Added
ui.showandui.hide, which let you control when UI components are displayed. Use them withautoShow: false. Example:batchSDK("ui.show", "banner").
Last updated

