> For the complete documentation index, see [llms.txt](https://docs.coda.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coda.co/codapay/in-app-payments/unity-sdk-internal-beta-testing-unity-native-integration/unity-sdk-internal-beta-testing-introduction/integration-guide/setup-for-sdk-initialization.md).

# Setup for SDK Initialization

To make sure the Coda SDK is ready to handle payments as soon as your game starts, you **must** add the **Coda SDK Prefab** to the very first scene that loads. If you skip this step, the SDK won’t initialize at runtime — meaning payment flows and event listeners will not work.

### Step 1: Add Coda SDK Prefab <a href="#add-coda-sdk-prefab" id="add-coda-sdk-prefab"></a>

Adding the Coda SDK Prefab into your game allows the SDK to initialize at runtime. One way to do this is by adding the Prefab to a scene.

{% hint style="danger" %}
Make sure to add the Coda SDK Prefab to the first scene that loads when the game starts
{% endhint %}

#### **1. Only if your project has multiple scenes:**

* **Open Your First Scene**
  * This is the scene that loads immediately when your game starts.
  * If you’re not sure, check your **Build Settings** (`File → Build Settings`) and see which scene is listed first.
  * Open that scene in the Unity Editor.

*(If your project has only one scene, skip this step — you’ll just add the prefab directly to that default open scene.)*

#### *2.* **Add the Coda SDK Prefab**

You can do this in either of two ways:

* **From the Menu**: Go to `Coda → Create Prefab`
* **Drag & Drop**:
  1. In the **Project** panel, navigate to: `Assets → Plugins → Coda → Prefabs`
  2. Drag the **Coda.prefab** into the **Hierarchy** panel

<figure><img src="/files/GRlAeAzVMABAQrFVZ6s4" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
💡 **Best Practice**: If your game uses multiple scenes, place the prefab in a persistent “bootstrap” scene that always loads first. This ensures the SDK is initialized before any gameplay or UI that might trigger a payment.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.coda.co/codapay/in-app-payments/unity-sdk-internal-beta-testing-unity-native-integration/unity-sdk-internal-beta-testing-introduction/integration-guide/setup-for-sdk-initialization.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
