> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encorekit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure()

> Initialize the Encore Unity package with your API key, options, and purchase controller, once, when your game starts.

Initializes Encore on the device. Call it once, from the Unity main thread, before you identify the player or present anything. Pass an [`IEncorePurchaseController`](https://docs.encorekit.com/publishers/unity/sdk-reference/purchase-controller) here if your offers sell a product: `Configure` is the only place to set one.

## Signature

```csharp theme={null}
public static void Configure(string apiKey, LogLevel logLevel = LogLevel.None)
public static void Configure(string apiKey, EncoreOptions options)
public static void Configure(string apiKey, IEncorePurchaseController purchaseController, EncoreOptions options = null)

public static bool IsConfigured { get; }
```

## Parameters

| Name | Type | Default | Description |
| - | - | - | - |
| `apiKey` | `string` | required | Your publishable key from the Dashboard, starting with `pk_` |
| `logLevel` | `LogLevel` | `LogLevel.None` | Sets `EncoreOptions.LogLevel` and leaves every other option at its default |
| `options` | [`EncoreOptions`](#encoreoptions) | `null`, read as `new EncoreOptions()` | Log level, unlock mode, and transaction linking |
| `purchaseController` | [`IEncorePurchaseController`](https://docs.encorekit.com/publishers/unity/sdk-reference/purchase-controller) | none | Your billing code. With no controller, Encore never asks for a purchase |

## EncoreOptions

```csharp theme={null}
public sealed class EncoreOptions
{
    public LogLevel LogLevel = LogLevel.None;        // native SDK logs, and this package's own logs
    public UnlockMode Unlock = UnlockMode.Optimistic; // when access is granted after an offer flow
    public bool TransactionLinking = true;            // links store purchases to the player for lift measurement
}

public enum LogLevel { None, Error, Warn, Info, Debug }

public enum UnlockMode
{
    Optimistic, // grant when the player comes back from the offer
    Strict,     // wait for the advertiser's postback
}
```

| Field | Type | Default | Description |
| - | - | - | - |
| `LogLevel` | `LogLevel` | `None` | How much the native SDK logs, and the level from which the package logs its own messages. At `None` the package logs nothing of its own, except the one error a trigger view logs for a blank ID or placement in the Inspector ([`EncoreTriggerView`](https://docs.encorekit.com/publishers/unity/sdk-reference/encore-trigger#encoretriggerview)). Android, iOS, and WebGL |
| `Unlock` | `UnlockMode` | `Optimistic` | `Strict` waits for the advertiser's postback; a verification that lands after the flow arrives on [`Outcomes`](https://docs.encorekit.com/publishers/unity/sdk-reference/outcomes) with `Kind = StrictUnlockVerified`. Android, iOS, and WebGL |
| `TransactionLinking` | `bool` | `true` | Links the store's purchases to the player for lift measurement. Android and iOS; WebGL has no store |

## Example

```csharp theme={null}
using EncoreKit;
using UnityEngine;

public class EncoreBootstrap : MonoBehaviour
{
    private void Awake()
    {
        Encore.Configure(
            "pk_your_api_key_here",
            new GamePurchases(), // your IEncorePurchaseController
            new EncoreOptions { LogLevel = Debug.isDebugBuild ? LogLevel.Debug : LogLevel.None });
    }
}
```

For reward placements only, `Encore.Configure("pk_your_api_key_here")` is enough.

## Notes

* Throws `ArgumentException` when `apiKey` is null or empty. It throws nothing else.
* A failure inside the native layer is caught and logged at `LogLevel.Warn`. Encore stays unconfigured, `IsConfigured` stays `false`, and you can call `Configure` again.
* `IsConfigured` is `true` once a `Configure` call succeeded. A later `Configure` is ignored and logged at `LogLevel.Warn`, so the purchase controller and the options can't change after that.
* [`IsClaimEnabled`](https://docs.encorekit.com/publishers/unity/sdk-reference/is-claim-enabled) can be set before `Configure`, which sends it.
* The package's own messages go to the Unity log. Failures inside the native bridges go to the iOS subsystem `com.encorekit.unity`, the Android tag `EncoreUnity`, or the browser console on WebGL.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.