Skip to content

Releases: BatchLabs/Batch-Web-SDK

4.1.1

25 Jul 08:48
Compare
Choose a tag to compare

Core:

  • Fixed a rare issue where some data could be attached to the wrong profile due to a race condition when calling profile.edit or trackEvent right after profile.identify.

4.1.0

27 Jun 14:09
Compare
Choose a tag to compare

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

08 Jan 10:13
Compare
Choose a tag to compare

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 defaultDataCollection configuration object to the Batch's setup method. This allows you to enable the geoip back-end resolution for the user's region attribute which is now disabled by default.
  • Added optional migrations configuration object to the Batch's setup method. 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 serviceWorker object.
  • automaticallyRegister replaced useExistingServiceWorker. Set it to false to prevent Batch from automatically registering
    its worker. Default: true.
  • waitTimeout replaces serviceWorkerTimeout but works the same.
  • registration allows 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.
    Using registration requires automaticallyRegister to be false. Not setting it defaults to navigator.serviceWorker.ready.
  • serviceWorkerPathOverride has been removed: manually register a service worker with your custom path and give the
    Promise to the SDK in registration.

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 setCustomUserID API (has been replaced with identify).
  • Removed getCustomUserID API. (no equivalent)
  • Removed setUserLanguage API (has been replaced with setLanguage).
  • Removed setUserRegion API (has been replaced with setRegion).
  • Removed editUserData API (has been replaced with edit).
  • Removed IUserDataEditor interface. (has been replaced with IProfileDataEditor).
  • Removed addTagAPI (has been replaced with addToArray).
  • Removed removeTagAPI (has been replaced with removeFromArray).
  • Updated trackEvent parameters (EventDataParams):
    • Added support for Array and Object attribute types.
    • Replaced optional tag attribute with $tags as reserved key under the attributes object.
    • Replaced optional label attribute with $label as reserved key under the attributes object.
  • Added profile API to get the public profile module. Please see API references for more info.
  • Added identify API under IBatchProfile as replacement of setCustomUserID.
  • Added edit API under IBatchProfile as replacement of editUserData.
  • Added setEmailAddress API (this requires to have a custom user ID registered).
  • Added setEmailMarketingSubscription API.
  • Added setLanguage API under IProfileDataEditor as replacement of setUserLanguage.
  • Added setRegion API under IProfileDataEditor as replacement of setUserRegion.
  • Added clearInstallationData API. 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

24 Feb 06:58
ec5d472
Compare
Choose a tag to compare

Core:

  • Changed rules used to determine whether events should be sent immediately to Batch's backend or enqueued.

Safari:

  • Enabled iOS Web Push. Requires iOS 16.4+ and for the PWA to be installed as a standalone app.

3.4.0

07 Dec 14:41
e8af964
Compare
Choose a tag to compare

Core:

  • subdomain is 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 alert UI 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

07 Jul 18:07
Compare
Choose a tag to compare

Core:

  • Improved validation of susbcriptions before they're sent to Batch's servers.

Safari:

  • Fixed an issue where UI Components would be stuck "loading" even after a user granted or denied the push permission due to a Safari bug.

3.3.0

25 May 12:17
Compare
Choose a tag to compare

🎉 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 call api.subscribe().