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.unity-sdk, distributed as a folder in the mistscale-sdk repository on GitHub — it is not published to any package registry. It brings its own WebSocket transport; no other dependencies are required.

  1. 1

    Clone the repository, or download a ZIP from the Code button (or a tagged build from Releases).

  2. 2

    Copy the unity/Packages/com.mistscale.game-sdk folder into your Unity project's Packages/ directory.

  3. 3

    Reopen Unity. The package appears under Packages → Mistscale Game SDK.

Copying the folder gives you a local snapshot you update by hand. If you would rather Package Manager track the repo directly, use Add package from git URL instead:

Package Manager → + → Add package from git URL
https://github.com/MistScale-AI/mistscale-sdk.git?path=unity/Packages/com.mistscale.game-sdk
No npm / scoped-registry install
The package is not published to npm or any other registry, so a scoped registry entry in manifest.json will not resolve it. Use one of the two methods above.

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.