# Install & Configure the SDK

## Install the SDK

Installing the LootLocker SDK in your project is very straightforward and flexible with different ways to set it up depending on engine version and personal preferences. Once you have downloaded the SDK, follow these steps to install the LootLocker SDK into your Unreal Engine project.

### Install from Unreal Marketplace

In the Epic Games Launcher, search for LootLocker SDK, click on the LootLockerSDK and click `Install to Engine`.

If you were previously using the plugin as a project plugin, delete the LootLockerSDK folder under `Plugins` directory in your existing Unreal project.

Open your Unreal project in the Unreal Editor, navigate to Edit/Plugins in the menu and search for LootLockerSDK.

Tick `Enabled`, and the editor should prompt you to restart Unreal.

Once restarted, click on **File**->**Refresh Visual Studio Project** in the menu.

{% tabs %}
{% tab title="Unreal 5" %}
{% hint style="info" %}
If you don't see "**Refresh Visual Studio Project**" in the File menu, click **Tools**->**New C++ Class**, select **None,** click **Next,** click **Create Class**, when compilation has finished you should see **Refresh Visual Studio Project** in the **File** menu.
{% endhint %}
{% endtab %}

{% tab title="Unreal 4.27 and lower" %}
{% hint style="info" %}
If you don't see "**Refresh Visual Studio Project**" in the File menu, click **File**->**New C++ Class**, select **None,** click **Next,** click **Create Class**, when compilation has finished you should see **Refresh Visual Studio Project** in the **File** menu.
{% endhint %}
{% endtab %}
{% endtabs %}

Click on **File**->**Open Visual Studio**.

Once the solution opens in Visual Studio, navigate to your projects Build.cs file located in;\
**Games** ->”**ProjectName**” -> **Source** -> “**ProjectName**” -> **Source** -> **ProjectName.Build.cs**

Add `{“LootLockerSDK”}` to the `PublicDependencyModuleNames` list (see example below).

```cpp
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "LootLockerSDK" });
```

Add `{“Http”, “Json”, “JsonUtilities”}` to the `PrivateDependencyModuleNames` list (see example below).

```cpp
PrivateDependencyModuleNames.AddRange(new string[] { "HTTP", "Json", "JsonUtilities" });
```

Continue to the next step of the tutorial to [configure the SDK in your project](#configure-the-sdk).

### Install from Github Repository

Download or clone the [repository](https://github.com/LootLocker/unreal-sdk) so that you have it on disk.

Copy the LootLockerSDK folder to the Plugins folder at the root of your Unreal Project. If the Plugins folder does not exist yet, create it.

Right click the `Unreal Engine Project Launch` file in the root of the project and click `Generate Visual Studio Project Files`.

Open your project's .sln file.

Open your project's `Build.cs` file and add the following.

Add `{“LootLockerSDK”}` to the `PublicDependencyModuleNames` list (see example below).

```cpp
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "LootLockerSDK" });
```

Add `{“HTTP”, “Json”, “JsonUtilities”}` to the `PrivateDependencyModuleNames` list (see example below).

```cpp
PrivateDependencyModuleNames.AddRange(new string[] { "HTTP", "Json", "JsonUtilities" });
```

Continue to the next step of the tutorial to [configure the SDK in your project](#configure-the-sdk).

## Configure the SDK

Now that you have installed the SDK into your Unreal project, you will want to connect the Unreal project to your game in the LootLocker Web Console. The following steps walk you through configuring the LootLocker Unreal Engine SDK to work with a game that has already been created in the LootLocker Web Console. If you haven’t created a game or account yet, please visit [console.lootlocker.com](https://console.lootlocker.com) or follow [this guide](https://docs.lootlocker.com/the-basics/readme).

### **Configure the SDK in Project Settings**

<figure><img src="https://534367586-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVu1MPzezO-NgvC98xh%2Fuploads%2Fgit-blob-63d5394d570992663127b7afe48bc098e0e97b20%2FProperties%20Example.png?alt=media" alt=""><figcaption></figcaption></figure>

1. Login to the LootLocker Web Console by visiting [console.lootlocker.com](https://console.lootlocker.com) and navigate to the Settings menu and the [API Keys section](https://console.lootlocker.com/settings/api-keys) in order to copy the Domain and API Keys.
2. In Unreal Engine, navigate to Edit/Project Settings and scroll down the left panel until you reach the Plugins section of the Project Settings. Click on LootLockerSDK.
3. Modify the following information:
   * **API Key** is found in Game Settings in the [LootLocker Web Console](https://console.lootlocker.com/settings/api-keys).
   * **Domain Key** is found in Game Settings in the [LootLocker Web Console](https://console.lootlocker.com/settings/api-keys).
   * **Game Version** refers to the current version of your game in the format 1.2.3.4 (the 3 and 4 being optional but recommended).
   * **Allow Token Refresh** can be selected so that the SDK automatically attempts to refresh the session token if it expires. Otherwise the session token needs to be renewed manually.

Deprecated Properties

* **Platform** is the name of the platform the game will be built for (e.g Steam, PSN, Android, iOS). **This property has been deprecated** and instead of using this, you should call the StartSession method for the platform you want to use.
* **On Development Mode** lets you test your unpublished changes in the LootLocker Management Console `Stage` environment (instead of `Live`). Checking this box will make the SDK target the `Stage` environment. If you want to understand this in more detail, check out the page [Stage & Live Environments](https://docs.lootlocker.com/the-basics/core-concepts/stage-and-live-environments). **This property has been deprecated**, instead use the corresponding api key. Stage keys begin with `dev_` and Live keys begin with `prod_`.

{% hint style="warning" %}
If you update the plugin in the future you might need to repeat some of these steps.
{% endhint %}

You should now have access to the SDK in both your C++ and Blueprint projects.


---

# Agent Instructions: 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:

```
GET https://docs.lootlocker.com/the-basics/unreal-quick-start/download-the-lootlocker-sdk.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
