> For the complete documentation index, see [llms.txt](https://doc.batch.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.batch.com/developer/sdk/web/advanced/2x-migration.md).

# Migrating from v2

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.

### Upgrading the SDK 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 [SDK files](https://download.batch.com/sdk/web/BatchSDK-web-3.5.0.zip) 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`.

### Safari support

Support for Safari push notifications has been introduced and requires additional configuration. See our [Safari documentation for more info](/developer/sdk/web/legacy-documentation/safari-setup.md).

### Removal of insecure HTTP/Multidomain mode

This SDK version has removed support for the [HTTP/Multidomain mode](/developer/sdk/web/legacy-documentation/unsecure-mode.md): 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.

{% hint style="info" %}
Note: Migrating a website from the HTTP/Multidomain mode should be done with care. Please reach out to our team before upgrading so we can discuss your specific goals and advise you on this topic.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://doc.batch.com/developer/sdk/web/advanced/2x-migration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
