# Initialisation

6. Create a TcSdkOptions object by using the tcOAuthCallback from the previous step and provide the context. Supply the appropriate customization settings to the relevant methods of TcSdkOptions and use the instance of tcSdkOptions to initialize the TcSdk in the next step.

<pre><code>val tcSdkOptions = TcSdkOptions.Builder(this, tcOAuthCallback)
.buttonColor(Color.parseColor("&#x3C;&#x3C;VALID_COLOR_HEX_CODE>>"))
          .buttonTextColor(Color.parseColor("&#x3C;&#x3C;VALID_COLOR_HEX_CODE>>"))
            .loginTextPrefix(TcSdkOptions.LOGIN_TEXT_PREFIX_TO_GET_STARTED)
            .ctaText(TcSdkOptions.CTA_TEXT_CONTINUE)
            .buttonShapeOptions(TcSdkOptions.BUTTON_SHAPE_ROUNDED)
            .footerType(TcSdkOptions.FOOTER_TYPE_SKIP)
            .consentTitleOption(TcSdkOptions.SDK_CONSENT_TITLE_LOG_IN)
            .sdkOptions(TcSdkOptions.OPTION_VERIFY_ONLY_TC_USERS)
<strong>            .build();
</strong></code></pre>

In case you do not wish to provide any customization settings and fall back to the default SDK settings, you may simply call -

```
val tcSdkOptions = TcSdkOptions.Builder(this, tcOAuthCallback).build()
```

7. Initialize TcSdk using the tcSdkOptions from the previous step :

```
TcSdk.init(tcSdkOptions)
```

Note: Truecaller OAuth SDK needs to be initialized only once in the component and the same instance can be accessed without the need to initialize it again, via **TcSdk.getInstance()**

Ideally, you should call the init() method when the component is getting created/initialized to avoid calling it multiple times.

The SDK init should always happen in a background thread. You can refer to an example snippet below <sub>\[Recommended]</sub> :&#x20;

<pre><code>launch {
  withContext(Dispatchers.IO) {
     TcSdk.init(tcSdkOptions)
<strong>   }
</strong>// Now can access TcSdk.getInstance()
}
</code></pre>

8. Once the SDK is initialized, check whether the OAuth functionality is usable or not by calling :

```
val isUsable = TcSdk.getInstance().isOAuthFlowUsable
```

If *isUsable* is True, you can proceed with further steps, otherwise, you’d have to fall back to some other mechanism ( your fallback verification flow ). Calling other SDK methods when isUsable is False would result in an exception, so please ensure to call this soon after initializing the SDK, and proceed to further steps only if this method returns True.


---

# 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.truecaller.com/truecaller-sdk/android/oauth-sdk-3.2.0/integration-steps/initialisation.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.
