# Provider Initialisation

{% hint style="info" %}
This function does not trigger any UI elements
{% endhint %}

## Description

The base component for the Metafi SDK which takes in your API Key, unique user ID, and other options as Arguments. Call this function as soon as your initial scene is loaded, before any other functions are invoked.

## Details

### Signature

{% code overflow="wrap" %}

```csharp
Task Init(string apiKey, string secretKey, dynamic options, List<Metafi.Unity.Chain> supportedChains, List<Metafi.Unity.Token> customTokens, bool metafiSSO = false)
```

{% endcode %}

### Arguments

<table><thead><tr><th width="211">Parameter</th><th width="101">Type</th><th>Definition</th></tr></thead><tbody><tr><td><code>apiKey</code></td><td>String</td><td>Your API Key. This can be displayed publicly</td></tr><tr><td><code>secretKey</code></td><td>String</td><td>Your Secret Key. Keep this securely and do not expose.</td></tr><tr><td><code>options</code></td><td>dynamic</td><td><p>A list of options to customise the look and feel of how the Metafi wallet looks. Here you can pass in a custom logo, as well as theme styling options. More information can be found in the <a href="broken-reference">UI customisation</a> section.</p><pre class="language-csharp"><code class="lang-csharp">dynamic options = new {
    logo = "./logo.png", // pass in the URL or path to your logo
    theme = new {
        fontColors = new { 
            primary = '#ffffff', 
            secondary = '#e8e8e8'
        },
        bgColor = "linear-gradient(40deg, rgba(209,29,255,1) 0%, rgba(7,52,235,1) 100%)",
        ctaButton" = new {
            color = "#430aa0",
            fontColor = "#ffffff"
        },
        optionButton = new {
            color = "rgba(0,0,0,0.1)",
            fontColor = "#ffffff"
        },
        metafiLogoColor = "light",
    },
}
</code></pre></td></tr><tr><td><code>supportedChains</code></td><td>List&#x3C;Metafi.Unity.Chain></td><td>An array of chains supported by your application. Please refer to the section on <a href="../constants/chain">Chains</a> for more information on what chains we support.</td></tr><tr><td><code>customTokens</code></td><td>List&#x3C;Metafi.Unity.Token></td><td><p>An array of custom tokens that you want supported in your users wallet. To pass a custom token, you will need to use the <code>Metafi.Unity.Token</code> constructor to generate a new token. The format of the inputs are as follows:<br></p><pre class="language-csharp" data-overflow="wrap"><code class="lang-csharp">Token (string name, string symbol, Metafi.Unity.Chain chain, string image, string contractAddress, int decimals)
</code></pre><p></p><p>You can refer to the <a href="#example">example</a> below to understand how to register Wrapped Ethereum in the wallet.</p></td></tr><tr><td><code>metafiSSO</code></td><td>bool</td><td>Specify whether to use MetafiSSO or not. Set to <code>false</code> if you are using your own custom login mechanism.</td></tr></tbody></table>

### Return Value

N/A

## Example

{% code lineNumbers="true" %}

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

public class StartButton : 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");
    }
}
```

{% endcode %}
