# Initializing the SDK

Initialize the SDK once per app session, preferably at app launch.

The following table provides a list of parameter values to include when you initialize the DT FairBid SDK:

| PARAMETER   | TYPE   | STATUS   | DESCRIPTION                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ----------- | ------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `DT_App_ID` | String | Required | <p>DT assigns the DT App ID to all apps added to the DT ecosystem via the DT Console. For more information about adding an app, see <a href="/pages/zrnLwhA1cqI7XJULEcKr">Setting Up DT FairBid</a>.<br>To locate the DT App ID, log in to the <a href="https://console.fyber.com/login">DT Console</a>, and go to <strong>Monetization→App Management</strong>. The <strong>Apps dashboard</strong> displays a list of your apps, and App IDs display below each app name.</p>                                                  |
| `user_id`   | String | Optional | <p>The <code>user\_id</code> is a unique identifier (256 characters or less) that allows you to differentiate individual app users.<br>DT recommends setting a <code>user\_id</code>, as it greatly assists with key functions such as <a href="/pages/A09UBRGMne9TzE5iT6Vs">server side rewarding</a> for rewarded ads, counting unique users accurately, and user level reporting.<br>Setting the <code>user\_id</code> at SDK initialization is optional; however, you must specify it prior to requesting a rewarded ad.</p> |

To initialize the DT FairBid SDK, use the following code snippets to specify your `DT_App_ID` and optional `user_id`.

{% tabs %}
{% tab title="Android" %}
{% code title="Kotlin" %}

```kotlin
import com.fyber.FairBid
FairBid.start("DT_App_ID", activity)
// recommended
UserInfo.setUserId("user_id")
```

{% endcode %}

{% code title="Java" %}

```java
import com.fyber.FairBid;
FairBid.start("DT_App_ID", activity);
// recommended
UserInfo.setUserId("user_id");
```

{% endcode %}
{% endtab %}

{% tab title="iOS" %}
{% code title="Swift" %}

```swift
import FairBidSDK
FairBid.start(withAppId: "DT_App_ID")
// recommended
FairBid.user().userId = "user_id"
```

{% endcode %}

{% code title="Objective-C" %}

```objective-c
#import <FairBidSDK/FairBid.h>
[FairBid startWithAppId:@"DT_App_ID"];
// recommended
[FairBid user].userId = @"user_id";
```

{% endcode %}
{% endtab %}

{% tab title="Unity" %}
{% code title="C#" %}

```csharp
using Fyber;
FairBid.Start("DT_App_ID");
// recommended
UserInfo.SetUserId("user_id");
```

{% endcode %}
{% endtab %}
{% endtabs %}


---

# 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.digitalturbine.com/dt-fairbid/fairbid-sdk/initializing-the-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.
