Skip to content

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

PlatformSDKLanguage
Web / HTML5@gametegra/gametegra-coreJavaScript
Unity (WebGL)com.gametegra.sdkC#
Godot (Web Export)gametegra_sdk pluginGDScript

Quick Start

JavaScript

js
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#)

csharp
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)

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:

js
const result = await gameTegra.createRoom({ maxPlayers: 4 })
// result content is determined by the backend

Unity/Godot: Returns the result data directly.

Next Steps