# VersionsInfo

> Contains information about available versions of a package, including compatible, latest, and recommended versions.

## Definition

* **Type:** Class
* **Namespace:** [UnityEditor.PackageManager](/engine/6000.6/script-reference/unityeditor/packagemanager.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public class VersionsInfo
```

## Remarks

* Version strings follow semantic versioning, whose format is `Major.Minor.Patch`. For example, "1.2.3"
* The recommended version might differ from the latest version, based on Unity Editor version compatibility.

```csharp
using System;
using UnityEngine;
using UnityEditor.PackageManager;
using UnityEditor.PackageManager.Requests;

[ExecuteInEditMode]
public class PackageVersionsInfoExample : MonoBehaviour
{
    SearchRequest m_Request;

    void Start()
    {
        Debug.Log("Getting package versions...");
        m_Request = Client.Search("com.unity.textmeshpro");
    }

    void Update()
    {
        if (m_Request != null && m_Request.IsCompleted)
        {
            if (m_Request.Status == StatusCode.Success)
            {
                var package = m_Request.Result[0];
                var versions = package.versions;

                Debug.Log($"Version info for {package.name}:");
                Debug.Log($"- Latest version: {versions.latest}");
                Debug.Log($"- Compatible version: {string.Join(", ", versions.compatible) }");
                Debug.Log($"- Recommended version: {versions.recommended}");

                Debug.Log("All available versions:");
                foreach (var version in versions.all)
                {
                    Debug.Log($"- {version}");
                }
            }
            else
            {
                Debug.Log($"Package search request failed: {m_Request.Error}");
            }
            m_Request = null;
        }
    }
}
```

**Related information**

* [PackageInfo](/engine/6000.6/script-reference/unityeditor/packagemanager/packageinfo.md)
* [Client.Search](/engine/6000.6/script-reference/unityeditor/packagemanager/client/search.md)
* [Semantic Versioning](https://www.semver.org)

## Properties

| Property                                                                                                        | Description                                                                                                                                               |
| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [all](/engine/6000.6/script-reference/unityeditor/packagemanager/versionsinfo/all.md)                           | All available versions of the package.                                                                                                                    |
| [compatible](/engine/6000.6/script-reference/unityeditor/packagemanager/versionsinfo/compatible.md)             | Versions of the package compatible with the current version of Unity.                                                                                     |
| [deprecated](/engine/6000.6/script-reference/unityeditor/packagemanager/versionsinfo/deprecated.md)             | Versions of the package that are deprecated.                                                                                                              |
| [latest](/engine/6000.6/script-reference/unityeditor/packagemanager/versionsinfo/latest.md)                     | Latest version of the package.                                                                                                                            |
| [latestCompatible](/engine/6000.6/script-reference/unityeditor/packagemanager/versionsinfo/latestcompatible.md) | Latest version of the package compatible with the current version of Unity.                                                                               |
| [recommended](/engine/6000.6/script-reference/unityeditor/packagemanager/versionsinfo/recommended.md)           | A version of the package recommended to use with the current version of Unity. If there is no recommended version, then this property is an empty string. |
