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

# SDK Overview

> SusaPlay SDK — installation, modules, and initialization

## Available SDKs

| Platform   | Package                    | Min version   |
| ---------- | -------------------------- | ------------- |
| Unity (C#) | `com.susaplay.sdk` via UPM | Unity 2021.3+ |

<Note>
  Unity is the only SDK today. There is no JavaScript or TypeScript package.
</Note>

Games run as WebGL builds inside the SusaPlay shell. The SDK communicates with the platform
through that shell rather than calling the API directly, so the same code works in production
and in the developer preview.

## Installation

Add to `Packages/manifest.json`:

```json theme={null}
{
  "dependencies": {
    "com.susaplay.sdk": "https://github.com/susaplay/com.susaplay.sdk.git"
  }
}
```

Or in Unity Package Manager → **Add package from git URL**:

```text theme={null}
https://github.com/susaplay/com.susaplay.sdk.git
```

Then run **susaplay → Create Config Asset** and fill in your game key.

## Modules

Every module hangs off the static `SusaPlaySDK` class and is populated by `Initialize()`.

| Property                | What it does                                          |
| ----------------------- | ----------------------------------------------------- |
| `SusaPlaySDK.Auth`      | Current player — uid, display name, guest flag        |
| `SusaPlaySDK.Purchases` | Platform wallet, store catalogue, real-money checkout |
| `SusaPlaySDK.CloudSave` | Versioned cloud save read and write                   |
| `SusaPlaySDK.Analytics` | Custom events                                         |
| `SusaPlaySDK.Webhooks`  | Server-to-server events for your own backend          |
| `SusaPlaySDK.Api`       | Authenticated calls to your own partner API           |
| `SusaPlaySDK.LiveOps`   | Campaign and offer content                            |

## Initialization

One call sets up everything. Identity is resolved by the shell during the handshake, so there
is no separate identity step.

```csharp theme={null}
using susaplay.SDK;
using UnityEngine;

public class Bootstrap : MonoBehaviour
{
    private async void Start()
    {
        await SusaPlaySDK.Initialize();

        // Every module is ready from here on.
        var wallet = await SusaPlaySDK.Purchases.GetPlatformWallet();

        SusaPlaySDK.MarkGameLoaded();
    }
}
```

<Warning>
  Await `Initialize()` before touching any module. The properties are null until it completes,
  and a second call while the first is still running is ignored.
</Warning>

If the shell does not respond within 15 seconds, initialization logs an error and gives up.
Guard against null modules if your game can run standalone.

## Version

The SDK reports its version to the shell during the handshake. Current release: **1.3.0**.

Some behaviour is version-gated — `session_start` analytics requires 1.3.0 or later. Rebuild
your game after upgrading the package; the version is compiled into the WebGL build.
