Installation
JavaScript (Web)
npm
bash
npm install @gametegra/gametegra-coreImport and Usage
js
import gameTegra from '@gametegra/gametegra-core'
// or named exports
import { gameTegraSDK, createGameTegraSDK } from '@gametegra/gametegra-core'When the SDK is imported, it automatically assigns a singleton instance to window.gameTegra.
SDK Readiness Check
js
// Method 1: onReady callback
gameTegra.onReady((detail) => {
console.log('SDK ready')
})
// Method 2: Wait with Promise
const detail = await gameTegra.waitUntilReady()
// Method 3: Check status
if (gameTegra.ready) {
// SDK is already ready
}Unity
Installation via UPM
- Create the
Packages/com.gametegra.sdkfolder in your Unity project - Copy the SDK files into this folder
- Unity will automatically detect the package
Usage
csharp
using GametegraSDK;
// All methods are accessible through the gameTegraSDK static class
var userInfo = await gameTegra.getUserInfo();Note: Unity SDK only works in WebGL builds. It returns simulated responses in the Editor.
Godot
Plugin Installation
- Copy the
addons/gametegra_sdk/folder into your project - Go to Project > Project Settings > Plugins > Enable the
Gametegra SDKplugin - The plugin automatically registers the
gameTegraautoload singleton
Usage
gdscript
# gameTegra is accessible as an autoload
var user_info = await gameTegra.getUserInfo()Note: Godot SDK only works in Web exports.
Next Steps
- Getting Started - Core concepts
- API Reference - Detailed reference for all methods