SDK changelog

Change log 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.js in the script tag, where v4 is 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.1.125/07/2024Download

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.027/06/2024Download

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.014/12/2023Download

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.023/02/2023Download

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.022/11/2022Download

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.108/07/2022Download

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.003/05/2022Download

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().

3.2.006/04/2022Download

User:

  • Added support for custom attributes and tags. See the documentation for more info.

3.1.017/03/2022Download

User:

  • Added support for custom events.
    See the documentation for more info.

3.0.316/12/2021Download

Core:

  • Enhance compatibility of UI Components with AMP pages with the Custom Elements polyfill applied.

UI Components:

  • Fix a regression on the alert UI Component where styling might not be applied properly

3.0.208/12/2021Download

Core:

  • Worked around an issue where the SDK would not start on websites where DOMContentLoaded is not bubbled.

3.0.117/11/2021Download

This is a major release, please see our Migration Guide for more info on what changed since 2.x.

Core:

  • Added support for Safari push notifications. This requires additional configuration on Batch's dashboard and the SDK's configuration: see our documentation for more info. Safari 12 or higher is required.
  • Removed support for HTTP/Multidomain mode (sameOrigin becomes deprecated, remove it to the SDK configuration). This requires a change to the SDK configuration: see our migration guide for more info.
  • defaultIcon and smallIcon are now optional and can be remotely configured using Batch's dashboard. Setting your own URLs is still supported.

UI Components:

  • If the defaultIcon image cannot be loaded, UI components will now hide the image rather than display the browser’s generic broken image placeholder.

2.3.022/11/2022Download

Core:

  • Ensure SDK stays disabled on future iOS versions. As of writing, v2 doesn't start on any iOS version: if you want to support iOS when web push becomes supported by Apple, please use the v3 or higher.

2.2.216/12/2021Download

Core:

  • Enhance compatibility of UI Components with AMP pages with the Custom Elements polyfill applied.
  • Worked around an issue where the SDK would not start on websites where DOMContentLoaded is not bubbled.
  • Fix an issue where the current "dev" config value was not logger properly.

2.2.115/09/2021Download

UI Components:

  • Fix an issue where alert styling would not be applied properly.

2.2.009/09/2021Download

Bumped minimal browser versions:

  • Edge (Old) 16 (unchanged)
  • Chrome 55 (previously 50)
  • Firefox 53 (previously 46)
  • Edge Chromium 77

Core:

  • Added getConfiguration(), which gets a readonly copy of the SDK configuration for debugging.
  • Better logging of service worker registration errors.
  • Added webp images for Firefox.
  • Fixed an issue where calling setup twice resulted in unexpected behaviour.

User:

  • set/get UserLanguage/UserRegion/CustomUserID's type checking have been improved:
    • They can no longer return undefined: They will always return null if not set.
    • They accept both null and undefined to unset their values.
  • Updated getInstallationID definition to match that it could never return null

UI Components:

  • Fix various theming issues on the button format.
  • Additional stable identifiers have been introduced on multiple formats.
  • Added a ui component that can display the public identifiers (Installation ID, Custom User ID, ...).
    It can be shown by calling 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 is now always opened.

2.1.022/11/2018Download

Core:

  • Reworked how including our service worker is done. It will now be automatically updated to the latest version. This also gets rid of the async importScripts which could cause issues in a shared service worker environment.

Note: This version comes with an update to the service worker loader and shared worker implementation. You will have to redownload batchsdk-worker-loader.js and deploy it to your website. If using the shared worker, download batchsdk-shared-worker.js and replace your existing setupSharedBatchSDK method with the new one.

If you rely on a shared service worker implementation, please upgrade ASAP to stay compatible with latest Chrome and Firefox versions.

2.0.923/10/2018

Core:

  • Fix an issue where the registration token would not be immediatly sent to the server, if the service worker had been unregistered by a 3rd party
  • Fix an issue where calling Batch's API would fail if called before the SDK is ready. Calls will now be enqueued properly.

UI Components:

  • Fix popin's title propery not being honored in configuration.

2.0.812/09/2018

UI Components:

  • Improved button format rendering on mobile devices.
  • Replaced header tags from UI components with more simple tags.
  • Fixed banner's left position.
  • Fixed a Firefox bug where alert might never appear.
  • Implement pushsubscriptionchange on the ServiceWorker
  • Lazy load help images for browser permission re-optin
  • Help images are now available in webp for chrome, and their PNG versions have been optimized

2.0.618/05/2018

  • Fix a link replacement bug in the popin UI component

2.0.514/03/2018

  • Fix Alert buttons not showing up on Chrome 58 and lower.

2.0.409/03/2018

  • Fix RTL text alignment on the Alert format
  • Fix some UI components not working anymore with Chrome 60 and lower

2.0.308/12/2017

  • Fix an issue where opening a notification in Chrome would not do anything

2.0.101/12/2017

  • Fix a registration bug with Chrome 62+ in multidomain/insecure mode
  • Fix an issue where the button's example push would show incorrectly

2.0.029/11/2017

  • Added a new UI component format: Alert
  • The "button" UI component now supports configuring a preview of the push notifications users rather than a placeholder
  • The "button" UI component now supports changing the bell's hover color, using the hoverForegroundColor configuration key
  • Exposed the previously undocumented "ui" object of the SDK's public API.
  • Most UI components now support a autoShow configuration option, preventing them to be automatically shown. (usage. ui:{ banner: { autoShow: false } })
  • Banner's hideFor default value is now 7 days
  • Added "ui.show", and "ui.hide" methods, allowing developers to have control over when UI components should be displayed. Should be used with autoShow: false. (usage: batchSDK("ui.show", "banner"))