Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.hyperx.dev/llms.txt

Use this file to discover all available pages before exploring further.

Overview

User Lifecycle is the first flow where a Unity client creates a player, signs in, and reads the current user inside a HyperX project. The shortest first experience is:
  1. Initialize the project with HyperX.Core.Init.
  2. Register or sign in a guest user with HyperX.Core.Users.StartGuest.
  3. Read the current user and representative character with HyperX.Core.Users.Me.
  4. Open the project Users page in Console and confirm the created user.

Start a guest user

using UnityEngine;

public class HyperXBootstrap : MonoBehaviour
{
    async void Start()
    {
        await HyperX.Core.Init("YOUR_PROJECT_CODE");

        string guestToken = SystemInfo.deviceUniqueIdentifier;
        var session = await HyperX.Core.Users.StartGuest(
            guestToken,
            country: "US",
            language: "en"
        );

        var me = await HyperX.Core.Users.Me(session.AccessToken);
        Debug.Log($"HyperX user: {me.Id}, character: {me.Name}");
    }
}
StartGuest automatically signs in if a user is already registered with the same authentication token. The same code works for the first run and repeat runs.

Confirm in Console

After running the Unity code, open the project in Console and go to Users. The user list shows:
  • user ID
  • authentication ID
  • registration type
  • country/language
  • representative character
  • last login time
This page is the first debugging point for confirming that SDK integration actually created a user.

Update the current user name

await HyperX.Core.Users.UpdateName(session.AccessToken, "Ari");

var updated = await HyperX.Core.Users.Me(session.AccessToken);
Debug.Log(updated.Name);
You can check name availability before updating it.
var result = await HyperX.Core.Users.CheckName(session.AccessToken, "Ari");

if (result.Available)
{
    await HyperX.Core.Users.UpdateName(session.AccessToken, "Ari");
}

Create and switch characters

var character = await HyperX.Core.Users.CreateCharacter(
    session.AccessToken,
    name: "Ari2"
);

await HyperX.Core.Users.UpdateRepresentativeCharacter(
    session.AccessToken,
    character.Id
);

Log out

await HyperX.Core.Users.Logout(session.AccessToken);
After logout, that access token can no longer be used. Call StartGuest or LoginGuest to play again.

Notes

  • The current SDK prioritizes the GUEST user flow.
  • authenticationToken is the value used to find the same user again. For a first Unity test, SystemInfo.deviceUniqueIdentifier is enough.
  • Games that manage their own guest token can pass a save-file ID, account-link ID, platform ID, or any project-specific stable value.
  • Server errors are thrown as HyperXServerException, including error code, message, and trace ID.