# Get Started

{% hint style="warning" %}
You will need an API Key to get started. Get your key by signing up on the [Developer Portal](https://developer-test.usemeta.fi/).
{% endhint %}

## Description

To get started with the Unity SDK, please follow the steps outlined below. If you face any issues, feel free to post your questions on our [Discord support channel](https://discord.gg/mjpyh64zEW).

## Step 1: Import Packages

You can download the latest version of our unity package from our [Github link](https://github.com/metafi-nft/metafi-unity-sdk/releases). Add this to your project under the `Assets` folder.

You will also need to purchase the [**Vuplex 3D WebView**](https://developer.vuplex.com/webview/overview) package for the relevant platform you require (Windows + Mac / iOS / Android), and place this package under the `Assets` folder of your project.

{% hint style="success" %}
You can get a 20% discount while purchasing the WebView from the Vuplex store by using the code `metafi` during checkout. Additionally will reimburse an additional $100 of your Vuplex purchase if you require; to claim this, you can book a call with us via this [link](https://calendly.com/raimie/metafi-call).
{% endhint %}

## Step 2: Import Prefab

Import the Prefab named `MetafiSDKPrefabDesktopNative` to your Hierarchy. Set the `sort order` of this Component to a high value so that it rests above your other UI elements. Adjust the reference resolution of this Component if required.

## Step 3a: Initialize the Provider

Under the `Start()` script of your first scene, Import the Metafi namespace and initialise the provider as shown below. More information on the Provider Initialization can be found [here](https://docs.usemeta.fi/unity-sdk/sdk-reference/provider-initialisation).

```csharp
using Metafi.Unity;
using System.Dynamic;

public class GameManager : MonoBehaviour {
    async void Start() {
        Debug.Log("Initializing Metafi Provider");

        dynamic _options = new ExpandoObject();
        _options.logo = @"Assets/Resources/logo-2.png";
        _options.theme = new {
            fontColors = new {
                primary = "#FFFFFF",
                secondary = "#e8e8e8"
            },
            bgColor = "#29327F",
            ctaButton = new {
                color = "#F19B28",
                fontColor = "#FFFFFF"
            },
            optionButton = new {
                color = "rgba(255,255,255,0.1)",
                fontColor = "#FFFFFF"
            },
            metafiLogoColor = "light",
        };
        
        Token wethToken = new Token(
            "Wrapped Ethereum",
            "goerliWETH",
            Chains.GOERLI,
            "https://d2qdyxy3mxzsfv.cloudfront.net/images/logo/ethereum.png",
            "0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6",
            18
        );

        await MetafiProvider.Instance.Init(
            "apiKey",
            "secretKey",
            _options,
            new List<Chain> {Chains.ETH, Chains.MATIC, Chains.GOERLI, Chains.MUMBAI},
            new List<Token> {wethToken},
            false
        );
        
        Debug.Log("Metafi Provider initialized");
    }
}
```

## Step 3b: Setup User Login

{% hint style="info" %}
This step is only required if you are using your own login/authentication mechanism
{% endhint %}

Go to the projects page of the [Developer Portal](https://developer-test.usemeta.fi/merchant/projects) and navigate to Settings. There you can update the URL which we will use to authenticate your user token. Once this URL is updated, you can create a wallet for a user by passing in their `userIdentifier` and `jwtToken` into our SDK.

More information on this can be found in the [Login](https://docs.usemeta.fi/unity-sdk/sdk-reference/login) section of our documentation.

## Step 4: Function Invocation

You're done! You can now invoke the functions that you need.

```csharp
using Metafi.Unity;

public class StartButton : MonoBehaviour {
    public async void ShowWallet() {
        await MetafiProvider.Instance.ShowWallet();
    }
}
```
