Developer Documentation · Getting Started
Client Init
Integrate the gamemantra SDK with a single initialisation call. The SDK handles offer delivery, economy telemetry, and UI rendering — no additional setup required beyond this.
Zero-Friction Integration Package
NewDownload a pre-configured ZIP from the dashboard — api_key, game_id, and base_url are injected automatically. Drag the folder into Unity or Unreal and press Play. No copy-paste required.
Player identity (gamemantra_config.json)
auto_login, player_id_source (device, advertising_id, custom, jwt) — same text as GameMantraConfig.cs in your download.
Prerequisites
- API key from the dashboard —
gm_live_sk_*(production) orgm_test_sk_*(sandbox) - Game UUID from Dashboard → Games
- Platform: Unity (C#), Unreal (C++), or Flutter (Dart)
- Android arm64 — Phase 1 target only
Initialise the SDK
Call once on game launch — before any scene or UI loads. The SDK connects to the backend, fetches your kill-switch state, and registers player callbacks.
#include <gamemantra.h>
// 1. Build the config JSON
const char* config = R"({
"api_key": "gm_live_sk_YOUR_KEY",
"game_id": "YOUR_GAME_UUID",
"environment": "production",
"base_url": "https://api.gamemantra.ai"
})";
// 2. Initialise the SDK (call once on game launch)
GM_Result result = GM_Init(config);
if (result != GM_OK) {
// Handle error — see GM_Result enum
}Start a Session
After GM_Init succeeds, start a session with a player ID and session UUID. This fires a session_start telemetry event and enables the offer pipeline.
// Called automatically by GM_Init — fires session_start event
// and fetches the current kill-switch level from the server.
GM_InitSession(
game_id, // UUID string
player_id, // your player's external ID
session_id, // UUID for this session
api_key
);Verify Initialisation
Check the device log for the boot sequence. All 7 Dart callbacks must register within ~100ms of engine start.
Shadow Mode (Auto-enabled)
After initialisation, your game automatically enters Shadow Mode. The AI computes offers silently — no offer is shown to players until you promote to Assisted mode from the dashboard.
Shadow
AI runs silently. No player impact.
Weeks 1–8
Assisted
Every offer needs your approval.
Weeks 9–16
Autonomous
AI acts within your guardrail bounds.
Week 17+