Skip to main content

Available SDKs

Unity is the only SDK today. There is no JavaScript or TypeScript package.
Games run as WebGL builds inside the SusaPlay shell. The shell starts the SDK, supplies the player’s token, and runs checkout and ads; other calls go straight to api.susaplay.com with that token. The same code works in production and in the developer preview.

Installation

Add to Packages/manifest.json:
Or in Unity Package Manager → Add package from git URL:
Then open SusaPlay → Setup, paste your game key, and click Save.

Modules

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

Initialization

One call sets up everything. Identity is resolved by the shell during the handshake, so there is no separate identity step.
Await Initialize() before touching any module. The properties are null until it completes, and a second call returns the same task. If initialization times out, Initialize() completes without throwing and the modules stay null; call it again to retry.
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.
In the Unity Editor, SDK 1.9.0 and later answer Initialize() with the Editor Simulator, so every module is ready in Play Mode without a build. See Test in the Unity Editor.

Back to the partner’s app

When a partner opens your game inside their own app, the player needs a way back. Show a button for it only when CanExitToHost is true, and call ExitToHost() when it is tapped:
CanExitToHost is false on SusaPlay itself, where there is no app to return to. Save first: the partner may close the game as soon as it gets the request. Requires SDK 1.12.0 or later. In the Editor Simulator, turn on Inside a partner’s app to test the button.

Version

The SDK reports its version to the shell during the handshake. Current release: 1.11.0. Some behaviour is version-gated — session_start analytics requires 1.3.0 or later, and the Editor Simulator 1.9.0 or later. Pin a release tag (#v1.11.0) for reproducible installs. Rebuild your game after upgrading the package; the version is compiled into the WebGL build.