Skip to content

4.0.0

Latest
Compare
Choose a tag to compare
@arnaud-roland arnaud-roland released this 08 Jan 10:13

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.