Getting Started
Gametegra SDK is an SDK that allows you to run your game within the SuperApp ecosystem. Your game is loaded as a mini-app inside SuperApp and communicates with platform features through the SDK.
SDK Selection
| Platform | SDK | Language |
|---|---|---|
| Web / HTML5 | @gametegra/gametegra-core | JavaScript |
| Unity (WebGL) | com.gametegra.sdk | C# |
| Godot (Web Export) | gametegra_sdk plugin | GDScript |
Quick Start
JavaScript
import gameTegra from '@gametegra/gametegra-core'
// Wait until SDK is ready
gameTegra.onReady((detail) => {
console.log('SDK ready!', detail)
})
// Get user info
const userInfo = await gameTegra.getInfo()
console.log('User:', userInfo)
// Create a room
const room = await gameTegra.createRoom({ maxPlayers: 4 })Unity (C#)
using GametegraSDK;
// Get user info
var userInfo = await gameTegra.getUserInfo();
Debug.Log($"User: {userInfo.name}");
// Create a room
var room = await gameTegra.createRoom(
gameTegra.@params("maxPlayers", 4)
);Godot (GDScript)
# gameTegra must be added as an autoload
var user_info = await gameTegra.getUserInfo()
print("User: ", user_info)
# Create a room
var room = await gameTegra.createRoom({ "maxPlayers": 4 })Core Concepts
Game Methods
Ready-made methods related to game logic. Directly accessible via the SDK for common operations such as room creation, joining, scoring, and saving data.
Game Method (Custom)
You can call backend functions not provided by built-in SDK methods via custom(). On JS, you can also define readable aliases using setMethodMap() + callGameMethod().
Common use cases:
- Inventory (
getInventory,useItem,buyItem) - In-game economy (
claimReward,upgradeItem) - Custom tournament/match flow (
joinTournament,submitRoundResult)
Stream & Realtime
Used for real-time data streaming:
- listenData - Listen to data coming from the platform (gyroscope, game events, etc.)
- sendData - Send data to the platform
App Methods (Native Features)
Methods that access device and platform features: camera, gallery, location, vibration, payment, language info, etc.
Response Format
All methods work asynchronously and return a Promise/Task/await.
JavaScript:
const result = await gameTegra.createRoom({ maxPlayers: 4 })
// result content is determined by the backendUnity/Godot: Returns the result data directly.
Next Steps
- Installation - Platform-specific installation steps
- Game Methods - Game methods (createRoom, saveData, etc.)
- Stream - Real-time data streams
- Game Method (Custom) - Custom backend method calls
- Controls - Virtual joystick and buttons
- Dev Console - In-WebView debug panel
- Full API Reference