> For the complete documentation index, see [llms.txt](https://docs.licensespring.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.licensespring.com/sdks/go-sdk/v2/breaking-changes.md).

# Breaking changes

### LicenseClient Updates

In SDK v1, `LicenseClient` was the primary interface through which client applications interacted with the SDK. It also handled responsibilities like saving the license file to storage. For example, methods like `LicenseClient.ActivateLicense()` and `LicenseClient.ActivateOffline()` would automatically persist the license data.

In SDK v2, we've introduced new higher-level layers that now wrap around `LicenseClient` and are responsible for tasks like license validation, storage, and management.

#### Offline Licensing Responsibilities Moved

Offline licensing logic has been **fully removed from LicenseClient**. The following functions have been **deprecated**:

* GenerateOfflineLicenseRequest
* ActivateOffline
* DeactivateOffline

Their logic has been moved to the **LicenseHandler**, which now automatically orchestrates the offline flow. Offline licensing involves **no real-time communication** with the LicenseSpring API. Now, LicenseClient strictly focuses on **online API interaction** only.

{% hint style="info" %}
The v1 version of `ActivateOffline()` had the option to **send the activation request directly** to the API. This is no longer available in v2. Instead, use the airgap functionality, or use the new offline flow that involves generating and transferring a license file.
{% endhint %}

This update brings the SDK more in line with the **security principles of true offline licensing**.

#### Hardware ID Validation Is Now Enforced

In v1, the SDK **did not validate** that the hardware ID in the activation request matched the machine actually performing the activation. This allowed users to generate an activation request on one machine and activate it on another — which **undermines the concept of node-locked licenses**. In v2, this has changed:

* The SDK now enforces **hardware ID checks** during license activation.
* If your workflow involves generating requests on one machine and activating on another, you **must explicitly set the hardware ID** of the target machine in the request generator.

#### Summary of Breaking Changes

|                   Feature |                       SDK v1 | SDK v2                  |
| ------------------------: | ---------------------------: | ----------------------- |
|      License file storage | Handled inside LicenseClient | Moved to LicenseHandler |
| Offline licensing methods |        Part of LicenseClient | Moved to LicenseHandler |
|   Hardware ID enforcement |                 Not enforced | Enforced                |

#### Migration Note

If you're still directly using `LicenseClient` in your application, you must update your code to use `LicenseHandler`. Otherwise, your license data will no longer be saved or updated, and you’ll lose critical logic like validation, storage, and offline flow handling.

{% stepper %}
{% step %}

### Update from LicenseClient to LicenseHandler

Replace direct calls to `LicenseClient` that relied on validation, storage, or offline flows with the corresponding `LicenseHandler` APIs. Ensure configuration includes storage location and validation behavior.
{% endstep %}

{% step %}

### Handle Offline Flow

Move any offline flow logic (generating license requests, transferring license files, applying offline activations) to the new `LicenseHandler` offline APIs. The LicenseHandler now orchestrates offline activation without real-time API communication.
{% endstep %}

{% step %}

### Hardware ID Workflows

If you currently generate activation requests on a different machine than the one performing activation, change your request-generation step to explicitly set the target machine's hardware ID in the request generator so the v2 hardware ID enforcement will pass.
{% endstep %}
{% endstepper %}

### Hardware ID Generation in SDK v2

SDK v2 introduces a new hardware ID generation module that supports multiple algorithms, allowing for greater flexibility and improved security. However, **none of the new algorithms produce the same hardware ID as SDK v1**.

If maintaining compatibility with the hardware ID from SDK v1 is important for your setup, you can explicitly configure the `LicenseHandler` to use the legacy method. That said, we **strongly recommend migrating to the new module**, as it offers better robustness and security.

To learn how to configure either the new algorithm or retain the old one, refer to the Configuration Guide for detailed setup instructions.

### License File Path

In SDK v2, the **default name and path of the license file have changed** to align with other SDKs. If you already have a license file stored in the **old default location** and you wish to continue using it **without moving it**, you’ll need to **manually provide its path** as a custom license file location during configuration.

### FloatingClient and ManagementClient Updates

In v1, support for the `FloatingClient` and `ManagementClient` was built-in. However, **these are not yet available in v2**. They are planned for future releases but **are not part of the initial version**.

{% hint style="warning" %}
If your project depends on `FloatingClient` or `ManagementClient`:

* Do not upgrade to v2 at this time, or
* Remove or isolate that logic until full support is released in a later version.
  {% 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.licensespring.com/sdks/go-sdk/v2/breaking-changes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
