Docs/Installation & Login

Installation & Login

Add the Mistscale package to Unity, authenticate with your API key, and browse your NPCs in the editor.

Setup is three steps: install the package, create a config asset, and log the editor in with your project's API key. Once logged in you can see every NPC in your project, with copyable IDs, directly inside Unity.

1. Install the package

The SDK ships as a Unity package named com.mistscale.game-sdk. Add it through the Unity Package Manager (Window → Package Manager → add from Git URL or from disk, depending on how you received the package). It brings its own WebSocket transport; no other dependencies are required.

2. Create the config asset

The SDK reads its configuration from a single ScriptableObject. Create it via Assets → Create → Mistscale → Config and place it in a Resources/ folder so it loads automatically at runtime.

ApiKey
Your project API key. Filled in for you by the editor login window; keys always start with ms_.
ControlPlaneUrl
The Mistscale REST API. Leave at the default unless support tells you otherwise.
NpcEndpointUrl
The realtime NPC endpoint your characters connect to. Leave at the default.
EnableLogging
Turns SDK console logging on or off. Useful during integration, noisy in production.

3. Log in from the editor

  1. 1

    Open the login window from the menu bar: Mistscale → Login.

  2. 2

    Click Get API Key. Your browser opens the dashboard's API Keys page for the active project (Project Settings → API Keys).

  3. 3

    Generate a key, copy it, paste it into the window, and click Verify.

  4. 4

    On success the window switches to a project view that lists your NPCs. Copy any NPC ID from here; you will need one for the next guide.

Treat the key like a secret
The API key authorizes conversations against your project and your usage limits. Keep it out of public repositories. For shipped games, prefer issuing keys per environment so a leaked key can be rotated without touching development setups.

Authenticating at runtime instead

If you would rather not ship a config asset, initialize the SDK in code before any NPC connects:

Bootstrap.cs
using Mistscale.SDK;
using UnityEngine;

public class Bootstrap : MonoBehaviour
{
    void Awake()
    {
        MistscaleSDK.InitializeWithKey("ms_your_key_here");
    }
}

Everything else behaves identically. The SDK is a self-managing singleton: the first component that needs it will create it, and it survives scene loads.