Quick start

From zero to your first request in about five minutes.

On this page

1. Create a project#

  1. Create an account and sign in to the dashboard.
  2. Create a project and keep Add Starter sample content switched on. It creates the coins leaderboard, the daily_coins reward and a few config keys used throughout these docs.
  3. Open API keys to find the Base URL, the Project ID and the client key (pk_live_…).

2. Install the SDK#

  1. Download the Unity SDK from the project page and import it with Assets ▸ Import Package ▸ Custom Package…
  2. Open Tools ▸ Majacloud ▸ Setup, paste the Base URL, Project ID and client key, then press Test connection.
  3. Optional: open Tools ▸ Majacloud ▸ Open Starter Sample and press Play to try every service.

3. Sign in and call a service#

Paste this into your game. It signs the player in as a guest, submits a score and reads a config value.

C#
using MajacloudSdk;
using UnityEngine;

public class GameStart : MonoBehaviour
{
    private async void Start()
    {
        // Restores the saved session or creates a guest
        var signIn = await Majacloud.Auth.SignInAnonymouslyAsync();
        if (!signIn.Ok)
        {
            Debug.LogWarning(signIn.Error.Message);
            return;
        }
        Debug.Log("Hello " + signIn.Value.DisplayName);

        await Majacloud.Leaderboards.SubmitScoreAsync("coins", 120);
        int damage = Majacloud.RemoteConfig.GetInt("enemy_damage", 25);
    }
}

4. Check the dashboard#

Open your project in the dashboard: the Getting started card switches to Connected, and every request appears under Logs with its status, latency and request ID.

Next steps#

Search page titles, headings and text.

↑↓ to navigate ↵ to open Esc to close