Initialize and load your game
Integrate your JS URL
Place the following code inside the <head></head>
of the page where SDK integration is needed.
Initialize your game in MiniTon
After integrating the SDK, the first step is to call the init function. This function returns data related to the match.
The SDK object can be accessed via MINITONSDK
, window.MINITONSDK
, or window['MINITONSDK']
Parameters: game_id
game_id
Integer
The game ID
Return Value: initData
game_id
Integer
Y
ID of the game.
game_name
String
Y
Game Name
match_id
Integer
Y
Match ID
match_token
String
Y
Token associated with the ongoing match
user_ticket
String
Y
Ticket identifying the user.
first_experience
Integer
Y
Indicates if it is the player’s first experience (0 = No, 1 = Yes). If the value is 1, a tutorial should be displayed.
taste
Integer
Y
Indicates if it is a trial play (0 = No, 1 = Yes)
auth_date
Integer
Y
Data Verification Timestamp
auth_sign
String
N
Data Verification Signature
language
String
N
These are abbreviations used to identify languages. Each abbreviation represents a specific language, such as:
en: English
zh: Chinese
ja: Japanese
ko: Korean
ar: Arabic
ru: Russian
id: Indonesian
th: Thai
es: Spanish
fr: French
user
UserInfo
N
User information including user ID, nickname, avatar URL, region, region code, and region icon URL.
status
Integer
N
Status
0=failed
1=match ready
2=match ended
error_msg
String
N
Error message (if any).
return_url
String
N
URL to return to MiniTon page after the game ends.
UserInfo
uid
Integer
User's Telegram ID
nickname
String
Nick name
avatar
String
User Avatar URL
region
String
Region Name
region_code
String
Region Code (ISO Alpha2 code), e.g., RU
region_icon
String
Region Icon URL
Response Example
initData
initData
Set Progress Bar Value
During the loading of game resources, this function should be called multiple times to control the progress bar display on the main game page. When the num value reaches 100, the progress bar will no longer accept changes.
Parameters: num
num
Integer
Progress value (range: 0 <= num <= 100)
Last updated