Releases: BatchLabs/Batch-Web-SDK
Releases · BatchLabs/Batch-Web-SDK
4.1.2
4.1.1
Core:
- Fixed a rare issue where some data could be attached to the wrong profile due to a race condition when calling
profile.editortrackEventright afterprofile.identify.
4.1.0
Core:
- Batch will now start even if the current browser does not support push messaging features.
Core - Service worker:
- Batch will now detect if the ServiceWorker isn't setup as expected and breaks the SDKs functionality.
4.0.0
This is a major release, please see our Migration Guide for more info on what changed since 3.x.
Core:
- Added builtin German translations.
- Added optional
defaultDataCollectionconfiguration object to the Batch'ssetupmethod. This allows you to enable the geoip back-end resolution for the user'sregionattribute which is now disabled by default. - Added optional
migrationsconfiguration object to the Batch'ssetupmethod. This allows you to disable data migrations to the new Batch user-centric data model (enabled by default).
Core - Service worker:
- Moved Service Worker related configuration keys in a
serviceWorkerobject. automaticallyRegisterreplaceduseExistingServiceWorker. Set it tofalseto prevent Batch from automatically registering
its worker. Default:true.waitTimeoutreplacesserviceWorkerTimeoutbut works the same.registrationallows you to have Batch use a specific Service Worker registration.
This can be a Service Worker registration for a sub-scope that does not control the current page.
Be careful: Batch can't check that this SW will properly work, your integration might break if your SW is not valid for push
notifications.
UsingregistrationrequiresautomaticallyRegisterto be false. Not setting it defaults tonavigator.serviceWorker.ready.serviceWorkerPathOverridehas been removed: manually register a service worker with your custom path and give the
Promise to the SDK inregistration.
Core - User/Profile:
In the past, data was siloed between different platforms. However, Projects remove this limitation by introducing profiles. Each Project is associated with a unified userbase made up of profiles. When users interact with any of the platforms (website, iOS app, Android app...) within a Project, their actions are fed into the associated Profiles.
Web SDK v4 APIs are fully compatible with profiles and allow you to set attributes and events on omnichannel profiles:
- Removed
setCustomUserIDAPI (has been replaced withidentify). - Removed
getCustomUserIDAPI. (no equivalent) - Removed
setUserLanguageAPI (has been replaced withsetLanguage). - Removed
setUserRegionAPI (has been replaced withsetRegion). - Removed
editUserDataAPI (has been replaced withedit). - Removed
IUserDataEditorinterface. (has been replaced withIProfileDataEditor). - Removed
addTagAPI (has been replaced withaddToArray). - Removed
removeTagAPI (has been replaced withremoveFromArray). - Updated
trackEventparameters (EventDataParams):- Added support for
ArrayandObjectattribute types. - Replaced optional
tagattribute with$tagsas reserved key under theattributesobject. - Replaced optional
labelattribute with$labelas reserved key under theattributesobject.
- Added support for
- Added
profileAPI to get the public profile module. Please see API references for more info. - Added
identifyAPI underIBatchProfileas replacement ofsetCustomUserID. - Added
editAPI underIBatchProfileas replacement ofeditUserData. - Added
setEmailAddressAPI (this requires to have a custom user ID registered). - Added
setEmailMarketingSubscriptionAPI. - Added
setLanguageAPI underIProfileDataEditoras replacement ofsetUserLanguage. - Added
setRegionAPI underIProfileDataEditoras replacement ofsetUserRegion. - Added
clearInstallationDataAPI. Clear all related data to the user's installation and wipe user's local data. This doesn't affect profile's data.
3.5.0
3.4.0
Core:
subdomainis now optional in the configuration object. Previously, omitting subdomain resulted in notifications not showing their icon and image and failing to open the website on click.
Safari:
- Batch now uses Web Push Protocol as default on Safari if a user is not already subscribed with APNS.
UI:
- The
alertUI component now supports adding a configurable "extra" button in its configuration. See the documentation for more info.
UI:
- Fixed an issue where the native UI component would not automatically resubscribe a user if the backoff duration was not elapsed.
3.3.1
3.3.0
🎉 First source available release
Core:
- Added
api.refreshServiceWorkerRegistration()to re-synchronize Batch's internal state with the current Service Worker registration. - Added
api.doesExistingSubscriptionKeyMatchCurrent()to check if the current Service Worker (if there is one) registration's push applicationServerKey matches
the one Batch is configured with.
See their jsdoc for more info.
User:
- Optimize custom data sync if no data has been set.
UI Components:
- Added the
showIfPermissionGranted(boolean, default: true) configuration option on the Alert format.
Setting it to false will make it so Alert doesn't show if the user has already granted the notification permission,
even if they're not subscribed to Batch. In that case, they will not be automatically resubscribed until you callapi.subscribe().