GameTribe

Quick Start

Get your Unity game integrated with GameTribe in 5 minutes.

Overview

The GameTribe Unity SDK provides everything you need to integrate your game with the GameTribe platform, including session management, event tracking, leaderboards, tournaments, and ads.

This guide will get you up and running with a basic integration in just a few minutes.

Step 1: Import the SDK

Download the GameTribe Unity SDK package and import it into your Unity project:

  • Open your Unity project
  • Go to Assets → Import Package → Custom Package
  • Select the GameTribeSDK.unitypackage file
  • Click Import to add all SDK files to your project

Step 2: Configure the SDK

Create a configuration asset to store your API credentials:

  • Right-click in your Project window
  • Select Create → GameTribe → Platform Config
  • Fill in your API Key and Game ID from the GameTribe dashboard
You can find your API credentials in the GameTribe dashboard after uploading your game.

Step 3: Add the SDK Manager

Add the PlatformSDK component to your scene:

  • Create an empty GameObject in your scene
  • Rename it to GameTribeSDK
  • Add the PlatformSDK component to it
  • Assign your PlatformConfig asset to the component

Step 4: Basic Integration

Add this script to handle the basic game flow:

GameController.cs
using UnityEngine;
using GameTribe.SDK;
public class GameController : MonoBehaviour
{
private int score = 0;
private bool isPlaying = false;
void Start()
{
// Wait for SDK to be ready
PlatformSDK.Instance.OnSDKReady += OnSDKReady;
// Get player stats when session is authenticated
PlatformSDK.Instance.Session.OnSessionAuthenticated += (response) =>
{
Debug.Log($"Welcome back! Your high score: {response.playerStats.highestScore}");
Debug.Log($"Your rank: #{response.playerStats.rank}");
};
}
void OnSDKReady()
{
Debug.Log("SDK Ready! Starting game...");
StartGame();
}
void StartGame()
{
isPlaying = true;
score = 0;
// Track game start
PlatformSDK.Instance.Events.SendGameStart();
}
void Update()
{
if (isPlaying)
{
// Your game logic here
score += (int)(Time.deltaTime * 10);
}
}
public async void GameOver()
{
isPlaying = false;
// Track game end
PlatformSDK.Instance.Events.SendGameEnd(score, Time.timeSinceLevelLoad);
// Submit score to leaderboard
var result = await PlatformSDK.Instance.Session.EndSessionAsync(score);
Debug.Log($"Game Over! Score: {score}");
if (result.success)
{
Debug.Log($"Score submitted! Session duration: {result.sessionDurationSeconds}s");
}
}
}

Step 5: Build for WebGL

GameTribe games run in the browser, so you need to build for WebGL:

  • Go to File → Build Settings
  • Select WebGL as your platform
  • Click Build
  • Upload the build folder to GameTribe
Make sure to test your game locally before uploading. The SDK uses mock responses in the editor for development.

What's Next?

You now have a basic integration! Here's what you can explore next:

  • Session Management — Learn about authentication, player stats, and heartbeats
  • Event Tracking — Track 30+ event types for detailed analytics
  • Ads Integration — Monetize your game with interstitial, rewarded, and banner ads
  • API Reference — Complete documentation of all SDK classes and methods