> For the complete documentation index, see [llms.txt](/llms.txt)

# Version Gate

Checks the agreement (terms of service) versions a player accepted, and the versions a client reports, such as its app and asset versions.




**About this demo**

The demo signs in automatically with an anonymous account. The account is shared across every demo in the showroom, so items and currency you get in one demo carry over to the others. Loading takes a moment. If the frame is too small, open the demo in a new tab.

## Overview

One version check covers both the agreements a player accepted and the app and asset versions the client reports. Answer the required `terms` (latest 2.0.0) and the optional `marketing`, pick the versions the client claims, and press **Check versions** to see ok, warning or error for each. The check passes only when nothing is an error, and then GS2 issues a project token.

## How to try it

1. Read the rule under **Terms and versions**. At first, **Your answers** shows **terms: not answered** and **marketing: not answered**.
1. Press **Check versions** without answering: `terms` and `marketing` are errors because they are unanswered, app 1.0.0 and asset 0.9.0 are errors too, and the verdict reads **Not passed: no project token.**
1. Press **Accept terms 1.0.0 (an old version)** and `terms` becomes a warning; press **Accept terms 2.0.0 (the latest)** and it is ok. `marketing` is ok whether you press **Accept marketing** or **Reject marketing**.
1. Press **App version ... (press to change)** and **Asset version ... (press to change)** to change what the client reports: app 1.0.0 (error), 1.1.0 (warning) or 1.2.0 (ok); asset 0.9.0 (error), 1.5.0 (warning) or 2.1.0 (ok).
1. With no errors left, press **Check versions**; the verdict reads **Passed: GS2 issued a project token.** Press **Clear my answers** to start over.

## GS2 services used

- [GS2-Version](/microservices/version/): GS2-Version defines the agreements a player answers, `terms` (required) and `marketing` (optional), and the `app` and `asset` versions the client reports, and keeps each player's answers. The version check rates each one as warning or error, and a player who passes gets the project token of a demo user that has no permissions at all.

## Use it in GS2 Studio

In GS2 Studio's Simple mode, open **Add features** and press **Add** on **Version Gate** to bring this feature into your own project. To point at the package directly, choose **Add from GitHub** and enter the package below.

```text
https://github.com/gs2io/gs2-studio-package/tree/main/foundation-liveops-version/packages/foundation-liveops-version
```

- Owner: `gs2io`
- Repository: `gs2-studio-package`
- Subdirectory: `foundation-liveops-version/packages/foundation-liveops-version`

## Source code

- Demo project: <https://github.com/gs2io/gs2-studio-package/tree/main/foundation-liveops-version/live-demo>
- Feature package: <https://github.com/gs2io/gs2-studio-package/tree/main/foundation-liveops-version>



