> For the complete documentation index, see [llms.txt](https://lync.gitbook.io/lync/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lync.gitbook.io/lync/products/metamask-wallet.md).

# Metamask Wallet

LYNC Metamask Wallet SDK is a one-stop solution for game developers to easily integrate Metamask into their game engine and deploy their game on multiple networks with just a few clicks. This SDK allows game developers to monitor gamers’ data via LYNC analytics system and update the SDK without leaving the game engine.

<figure><img src="/files/4rZYYGrPA22SirECAN0V" alt=""><figcaption><p>Integrate Metamask wallet inside any game using LYNC SDK</p></figcaption></figure>

## Get Your API Key&#x20;

Please get your API key before downloading the SDK from [**here**](https://www.lync.world/form.html)

## Installation

Download the LYNC - Metamask Wallet SDK from [**here**](https://github.com/LYNC-WORLD/Metamask-Unity-Wallet-SDK)<br>

Import the SDK .unitypackage file to your project. or simply drag and drop .unitypackage file to your project.

<figure><img src="/files/ZOxvCM5mHIK23sqZKmoO" alt=""><figcaption><p>Assets -> Import Package -> Custom Package</p></figcaption></figure>

Once the Metamask Wallet SDK package has finished importing into your Unity project, you can begin integrating it into your game. To do this, open the **ConnectWallet** scene provided by the LYNC - Metamask SDK.\
\
&#x20;                                            **Path : Assets ->LYNC-Metamask-SDK -> Scenes**<br>

<figure><img src="/files/2Q17jvrURq99NRDDSOsz" alt=""><figcaption><p><strong>Assets ->LYNC-Metamask-SDK -> Scenes</strong></p></figcaption></figure>

## Choose blockchain network&#x20;

{% hint style="info" %}
If you haven't generated API Key, please check [#get-your-api-key](#get-your-api-key "mention")
{% endhint %}

After opening **ConnectWallet** scene, Go to **Interface.** In the "Inspector" window, go to the API key & Enter the **API key**.&#x20;

<figure><img src="/files/BROEKhh7HJcC9l5PktvW" alt=""><figcaption></figcaption></figure>

To choose the blockchain network, simply go to the **CurrentChain** drop-down menu and pick the network of your preference to deploy your game on.

<figure><img src="/files/3sGSj9Xe4fHCPrbNsqJd" alt=""><figcaption><p>Interface -> CurrentChain -> Choose Your Chain</p></figcaption></figure>

## Integrating ConnetWallet scene into the build&#x20;

To deploy your Unity project, it's necessary to set up the Player Settings in Unity. Follow these steps to select the LYNC WebGL template.

<figure><img src="/files/DXxDHLZH7ryfrLKOPoO5" alt=""><figcaption><p>File -> Build Settings</p></figcaption></figure>

In the "**Build Settings**" window, place **ConnectWallet** and **FetchWallet** at the top of this section.&#x20;

<figure><img src="/files/hnXXn2Jnkyq2rhdAU7qO" alt=""><figcaption><p>Add ConnectWallet &#x26; FetchWallet Scene to the top of Scenes in Build</p></figcaption></figure>

Go to "**Player Settings**" and navigate to "**Resolution and Presentation**". **Select LYNC - Template** in WebGL Template

<figure><img src="/files/YegsxNgCDuWxy9WEFS7B" alt=""><figcaption><p>Player Settings -> Resolution and Presentation -> Select LYNC - Template</p></figcaption></figure>

After completing all the necessary steps and configuring the Player Settings with the LYNC WebGL template, you can now build and run your game.

* To do this, go to "**File**" on the top menu bar in the Unity editor and select "**Build and Run**."&#x20;

<figure><img src="/files/qSb6qB2mV2jQuJszRQ5a" alt=""><figcaption><p>Build and Run </p></figcaption></figure>

Congratulation, you have successfully integrated the Metamask wallet with your favourite blockchain network using LYNC SDK. \
\
NOTE: If you wish to use wallet address inside game after user's wallet is connected, use:

```
PlayerPrefs.GetString("WalletAddress");
```

If you face any error, while Build and Run.\
\
PLEASE ADD, Unity package install by git link\
\
com.unity.nuget.newtonsoft-json

<figure><img src="/files/D72XvPGZk4IAisG4BKMm" alt=""><figcaption></figcaption></figure>


---

# 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://lync.gitbook.io/lync/products/metamask-wallet.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.
