> For the complete documentation index, see [llms.txt](https://docs.valist.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.valist.io/monetization/token-gating-unity-projects.md).

# Token-gating Unity Projects

{% hint style="warning" %}
This page is under re-construction! Stay tuned for updates!
{% endhint %}

Once you've created a License NFT (ERC1155), it's up to you how you'd like to token gate!

The general flow for token gating your software is to:

1. &#x20;Connect to the user's wallet
2. Sign a message to authenticate the user
3. Recover the address from the signature
4. Check the user's License NFT balance
5. Start your application if they have a License token. If they don't, redirect them to your Valist Project page, or enable in-app purchasing of the License.

For Unity games and applications, we recommend:

* [ChainSafe Gaming](https://gaming.chainsafe.io/) SDK (Developer [Docs](https://docs.gaming.chainsafe.io/erc1155))
  * Example [script](https://gist.github.com/nasdf/d8b7fb4e570e563e990c52501bdfdfa7)
* Moralis Unity SDK (Developer [Docs](https://github.com/ethereum-boilerplate/ethereum-unity-boilerplate))

A starter template for ChainSafe Gaming & Valist Software License NFTs can be found here:

{% embed url="<https://github.com/valist-io/valist-chainsafe-gaming-starter>" %}

The following script enables quick signing, you just simply need to attach this to a `Login` object in your Unity game!

{% embed url="<https://gist.github.com/nasdf/d8b7fb4e570e563e990c52501bdfdfa7>" %}
NFTLicense.cs
{% endembed %}

Another example can be found here:

{% embed url="<https://youtu.be/aurYZhPkRQw>" %}


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.valist.io/monetization/token-gating-unity-projects.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
