Last updated October 5, 2026
Initialize C# SDK
Initialize the SDK before calling any other API. The InitSDK call configures the runtime environment and must succeed before subsequent calls are made.
TT.InitSDK(param)
Initializes the TikTok mini games SDK. Call this method once when the game starts, before invoking any other TT SDK API.
Signature
public static void InitSDK(InitSDKParam param)Parameters
Field | Type | Description | Required |
|
| The mini game App ID | Yes |
|
| Callback invoked when user info is retrieved | No |
|
| Callback invoked when launch options are retrieved | No |
|
| Callback invoked when container info is retrieved | No |
|
| Whether to enable debug mode | No |
Example
TT.InitSDK(new InitSDKParam
{
GameID = "your_game_id",
OnGetUserInfo = info => Debug.Log("User info received"),
OnGetLaunchOptions = options => Debug.Log("Launch options received"),
OnGetContainerInfo = info => Debug.Log("Container info received"),
IsDebug = true
});