# Versioning

This describes how Mosaic Platform SDK is versioned.

## Semantic versioning

The Platform SDK follows the semantic versioning standard. This means each version number is comprised of X.Y.Z, where:

- X corresponds to a major version
- Y correponds to a minor version
- Z corresponds to a patch


With the new release, the SDK version number is updated incrementally depending on the changes introduced in the SDK. A new version includes new features, bugfixes, and occasionally breaking changes. For information on SDK updates, refer to [Changelog](/sdk-ref/platform/changelog).

When loading an SDK, you can decide which version to target. There are several options and considerations when it comes to specifying a version.

## Using the latest 2.x (recommended)

To ensure your integration isn't affected by breaking changes but still includes fixes and new features, consider targeting a specific major version (`X.x`). Your code will load the latest available minor version and patch released for this major version. For example, if `2.2.0` is the latest SDK version available, then specifying the version as shown below will load `2.2.1`, then `2.2.2`, then `2.3.0` and `2.3.1` once they are released but won't load `3.0`, etc.

Important
Platform SDK v1 will no longer receive updates. The `latest` will remain frozen on the last v1 release. To receive ongoing updates, all customers are advised to upgrade to v2.x by explicitly installing a 2.x version. See [Migration guide](/sdk-ref/platform/migration).

The example below points to the major version range.

script tag

```html
<script src="https://platform-websdk.transmitsecurity.io/platform-websdk/2.x/ts-platform-websdk.js" defer="true" id="ts-platform-script"></script>
```

npm

```bash
npm install @transmitsecurity/platform-web-sdk@^2
```

yarn

```bash
yarn add @transmitsecurity/platform-web-sdk@^2
```

## Using a minor version range

Targeting the latest patch for a specific minor version (`X.Y.x`) brings extra stability to your integration. In this case, the latest SDK within the minor version range will be installed. For example, if `2.1.3` is currently the latest version available for `2.1`, then specifying the version as shown below will load `2.1.3`, and then `2.1.4` and `2.1.5` once released. Versions such as `2.2.0`, `2.2.1`, or `2.3.0` won't be loaded.

script tag

```html
<script src="https://platform-websdk.transmitsecurity.io/platform-websdk/2.1.x/ts-platform-websdk.js" defer="true" id="ts-platform-script"></script>
```

npm

```bash
npm install @transmitsecurity/platform-web-sdk@~2.1.3
```

yarn

```bash
yarn add @transmitsecurity/platform-web-sdk@~2.1.3
```

## Using a specific version

You may prefer to target a specific SDK version (`X.Y.Z`) and perform SDK updates upon explicit testing and verification. Below is an example that invokes a specific version.

script tag

```html
<script src="https://platform-websdk.transmitsecurity.io/platform-websdk/1.18.2/ts-platform-websdk.js" defer="true" id="ts-platform-script"></script>
```

npm

```bash
npm install @transmitsecurity/platform-web-sdk@1.18.2
```

yarn

```bash
yarn add @transmitsecurity/platform-web-sdk@1.18.2
```