Skip to content

Installation

JavaScript (Web)

npm

bash
npm install @gametegra/gametegra-core

Import 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

  1. Create the Packages/com.gametegra.sdk folder in your Unity project
  2. Copy the SDK files into this folder
  3. 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

  1. Copy the addons/gametegra_sdk/ folder into your project
  2. Go to Project > Project Settings > Plugins > Enable the Gametegra SDK plugin
  3. The plugin automatically registers the gameTegra autoload 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