Companion apps

Bots, OSC and identity

Talk to the GoodMorningVR app on someone's own PC over OSC, join a server as a headless .NET client, and work with player identities.

Pick the right surface

You want to…Use
Drive a player's avatar or chat box from a desktop tool (face tracking, music status, a chat overlay)OSC, on that player's machine
Show who's online, post announcements, schedule world changesThe server REST API
Add new in-world behaviour that the server enforcesA server package plus a client addon
Put a presence in the world: a greeter, test traffic, a recorderA headless client

OSC (on the player's PC)

The client runs an OSC endpoint that's compatible with the tools people already use for other social VR apps. It listens on UDP 9000 and sends to UDP 9001, both on the local machine. It also advertises itself over OSCQuery (_oscjson._tcp via mDNS), so tools that support OSCQuery find it automatically. Players can turn it off with the OSC setting. It's on by default.

AddressArgumentsEffect
/avatar/parameters/<name>float, int or boolSets an avatar parameter, for example face-tracking blendshapes. The avatar decides what each parameter drives.
/chatbox/inputstring text, bool send now (default true), bool play sound (default false)Sends a chat message. The text is cleaned up the same way as typed chat, and ordinary chat rate limits apply.
/chatbox/inputa single boolShows or hides the typing indicator.

OSC only reaches the player's own client. It can't reach other players or the server directly, which is why it needs no key. Chat sent through it is end-to-end encrypted like any other chat, and the Community Guidelines apply.

# Python, with python-osc
from pythonosc.udp_client import SimpleUDPClient

osc = SimpleUDPClient("127.0.0.1", 9000)
osc.send_message("/chatbox/input", ["Now playing: Morning Coffee", True, False])
osc.send_message("/avatar/parameters/MouthOpen", 0.4)

Player identity

There are no central accounts in the VR app. Each install creates an Ed25519 key pair, and the player's identity is the public key written as a did:key string, such as did:key:z6Mk…. That's the uuid the REST API reports.

  • Servers verify it on every connect. The server sends a fresh challenge. The client signs a transcript that binds the challenge, the server's id and the connection's encryption keys (basis-did-login-v2). The server checks the signature before it lets any other traffic through.
  • So trust the identity, not the name. Display names aren't unique, and players can change them. A uuid reported by a server you control has been verified by that server. Use it as the key for anything you store about a player.
  • One identity per install, for now. A player who reinstalls or moves to a new PC without their key shows up as a new identity. Handle that with a re-link flow, not a hard failure.
  • GoodMorningVR website accounts are separate. Signing in on this site doesn't involve the in-game key, and there's no "sign in with GoodMorningVR" for third-party sites yet. Never ask players for their key files.

Can you check a did:key yourself? Yes. The Basis.Contrib.Auth.DecentralizedIds library (DidKeyResolver, DidAuthentication.MakeChallenge / VerifyResponse) resolves a did:key to its public key and checks Ed25519 signatures. But the shipped client only signs server sign-in challenges. To link a player to your own service, do it through a server you run: for example, a server package that pairs the verified uuid with a one-time code your website issued.

Headless clients

BasisNetworkClient is the client networking library without Unity. It targets netstandard2.1 and net10.0, and depends on BasisNetworkCore and the Contrib DID and crypto libraries. Reference those projects from the server solution, or the package built in Release. BasisNetworkClientConsole is a complete working example: it's the load-test bot that joins hundreds of simulated players.

What a server checks

  1. Protocol version. It must match the server exactly. It's currently 58: BasisNetworkVersion.ServerVersion, which /health also reports.
  2. Company and product name. These must match the server's CompanyName/ProductName settings.
  3. Password, as UTF-8 bytes, when the server sets one.
  4. The identity challenge, answered by signing with your bot's own key.
  5. DisallowHeadless. Servers can refuse headless clients entirely. Respect that, and ask the operator first.

Rejections carry a reason: 1 version mismatch, 2 server full, 3 wrong password.

Connecting

BasisNetworkPackages.Initialize(typeof(BasisNetworkPackages).Assembly, typeof(NetworkClient).Assembly);

BasisDIDAuthIdentityClient.ClientKeyCreation(out (PubKey, PrivKey) keys, out Did did);

ReadyMessage ready = new ReadyMessage
{
    playerMetaDataMessage = new ClientMetaDataMessage
    {
        playerDisplayName = "Morning Greeter (bot)",
        playerUUID = did.V,
        playerPlatform = "Bot",
    },
    clientAvatarChangeMessage = new ClientAvatarChangeMessage { /* avatar to show */ },
    localAvatarSyncMessage = new LocalAvatarSyncMessage { /* initial pose */ },
};

Configuration configuration = new Configuration { UseAuthIdentity = true };
NetworkClient client = new NetworkClient();
NetPeer peer = client.StartClient("play.example.com", 4296, ready,
    Encoding.UTF8.GetBytes(serverPassword), "Basis Unity", "Basis Unity",
    configuration, manualMode: true);

client.listener.NetworkReceiveEvent += (fromPeer, reader, channel, delivery) =>
{
    if (channel == BasisNetworkCommons.AuthIdentityChannel)
    {
        if (BasisDIDAuthIdentityClient.RespondToChallenge(client, keys.Item2, did.V, reader, out NetDataWriter reply))
        {
            fromPeer.Send(reply, BasisNetworkCommons.AuthIdentityChannel, DeliveryMethod.ReliableOrdered);
        }
        reader.Recycle();
        return;
    }
    // channel 1 (metaData) arriving means you're in
    reader.Recycle();
};

while (running)
{
    client.Poll();
    client.Update(15);
    await Task.Delay(15);
}
client.Disconnect();
  • Use the company and product names your target server expects. "Basis Unity" is the default.
  • Keep the bot's key pair and reuse it, so the bot has the same identity every time and operators can grant it permissions.
  • Give it a display name that clearly says it's a bot.
  • Avatar poses are encrypted by default (SealedAvatarPoses). The library's BasisSealedAvatarSender handles that. Plain poses are dropped.

Chat from a bot

Chat is end-to-end encrypted between clients. A bot that reads or posts chat has to join the key exchange with BasisE2EKeyManager, then use BasisChatCrypto.TryWriteSealed and TryOpen. The relay limits chat to 2 messages a second (bursts of 6). The load-test bot doesn't do chat, so expect to work through this part yourself. Bots that read chat must say so clearly in their name and follow the Community Guidelines.

Channel map

For reading traffic and debugging tools: the transport has 64 channels. Constants live in BasisNetworkCommons.

IdPurposeIdPurpose
0Sign-in and identity24Scene
1Player metadata (join complete)25–28Load, unload, preload, spawn resources
2Disconnection29Content share
3–5, 39–40, 49–51Voice and audio recipients30Avatar deltas
6–13, 41–48Avatar poses by quality tier31Server-bound messages
14–15Avatar change and avatar messages32Storage
16–17Create remote players33End-to-end key exchange
18Chat (sealed)34Admin
19–21Ownership get, change, remove35Server statistics
22–23Network id assignment38Events
36–37Camera picture-in-picture52–59Avatar bundles, server library, P2P, direct scenes and avatars
60Plugin message registry61–63Plugin messages: reliable, sequenced, unreliable

The channel layout belongs to the protocol version. Any version bump can change it.