Batch Web SDK v3 is a major release, which introduces breaking changes from 2.x. This guide describes how to update the script in a website already using a previous version.
To upgrade from v2 to v3, you need to change the SDK version in two places:
On your page script or tag manager, replace https://via.batch.com/v2/bootstrap.min.js with https://via.batch.com/v3/bootstrap.min.js.
Download the new and update your service worker implementation
If you're using batchsdk-worker-loader.js, simply replace this file with the new one.
If you added Batch in your custom service worker implementation, set BATCHSDK_MAJOR_VERSION's value to 3.
Support for Safari push notifications has been introduced and requires additional configuration. See our .
This SDK version has removed support for the : HTTPS is now required to use the SDK and origins are isolated as expected by web standards.
As migrating from the multidomain mode has implications developers need to be aware of, the SDK will refuse to start if sameOrigin: true is set in the configuration. Remove it once you want to start your migration.