Add cross-platform leaderboards to your game in minutes with the official LEADR SDK for Unity Engine.
New to LEADR? Follow the Quick Start guide to create your account and set up your first leaderboard.
- Easy integration - Automatic authentication and token management
- Anti-cheat Protection - Server-side validation and rate limiting
- Async/Await - Modern Unity async patterns
- Drop-in UI Components - Pre-built leaderboard and submission forms to get you started
- Unity 2020.3 or later
- (Unity 2021.2+ for UI Toolkit components)
- A LEADR account and game ID - if you don't have these yet, follow the Quick Start guide first
Coming soon...
- Open Window > Package Manager
- Click + > Install package from git URL...
- Enter:
https://github.com/LEADR-Official/leadr-sdk-unity.git?path=Packages/com.leadr.sdk
Create a LeadrSettings asset with your game ID:
- In the Project panel, right-click in your desired folder (e.g., Assets/Settings/)
- Select Create > LEADR > Settings
- Name the asset LeadrSettings (or any name you prefer)
- Select the asset to configure it in the Inspector
- Update the
LeadrSettingsasset with your GameId (get this from the LEADR app).
For full usage examples and API reference, see the SDK Documentation.
using Leadr;
using UnityEngine;
public class LeadrDemo : MonoBehaviour
{
async void Start()
{
// Get leaderboards
var boardsResult = await LeadrClient.Instance.GetBoardsAsync();
if (boardsResult.IsSuccess)
{
foreach (var board in boardsResult.Data.Items)
Debug.Log($"Board: {board.Name}");
}
// Get scores for a specific board
var scoresResult = await LeadrClient.Instance.GetScoresAsync("brd_your_board_id", limit: 10);
if (scoresResult.IsSuccess)
{
foreach (var score in scoresResult.Data.Items)
Debug.Log($"#{score.Rank} {score.PlayerName}: {score.Value}");
}
// Submit a score
var submitResult = await LeadrClient.Instance.SubmitScoreAsync(
"brd_your_board_id", 12345, "Player Name");
if (submitResult.IsSuccess)
Debug.Log($"Score submitted! Rank: #{submitResult.Data.Rank}");
else
Debug.LogError($"Error: {submitResult.Error}");
// Get your own scores for a board
var myScoresResult = await LeadrClient.Instance.GetMyScoresAsync("brd_your_board_id");
if (myScoresResult.IsSuccess)
{
foreach (var score in myScoresResult.Data.Items)
Debug.Log($"My score: {score.Value}");
}
}
}| Property | Type | Default | Description |
|---|---|---|---|
gameId |
String | required | Your LEADR game UUID |
baseUrl |
String | https://api.leadrcloud.com |
API endpoint |
debugLogging |
bool | false |
Enable verbose logging |
testMode |
bool | false |
Mark scores as test data |
Import samples via Window > Package Manager > LEADR Unity SDK > Samples. Includes Basic Integration, Canvas Example, and LeadrUIComponents demos.
- Full Integration Guide - Complete documentation with UI components, advanced usage, and troubleshooting
- Samples - Sample scenes demonstrating SDK features
- Join the Community!{"target"="_blank"} - Get support and inspiration on the LEADR Discord