BDG Chat

Docs

Connect your game or app to Live Chat API using HTTP for auth and WebSockets for real-time rooms.

Godot plugin

Official Godot 4 addon (v1.0.0-alpha, Godot 4.7.1+): store.godotengine.org/asset/xstreamio/bdg-chat

  1. Install addons/bdg_chat and enable the BDG Chat plugin.
  2. Add a BDGChatClient node (or open the included chat_demo.tscn).
  3. Set app_id and a player_token minted on your server, then connect_to_chat() and join("lobby").
$Chat.app_id = "app_xxxxxxxx"
$Chat.player_token = player_jwt_from_your_game_server
$Chat.connect_to_chat()
await $Chat.connected
$Chat.join("lobby")
$Chat.send_chat("hello")

Do not put sk_live_... in a shipped game. Use BDGPlayerTokens.mint() only on a trusted server.

Unity plugin

Same protocol as Godot. Package: unity/com.xstreamio.bdg-chat (Unity 2021.3+, editor and standalone). Add via Package Manager → Add package from disk.

var chat = gameObject.AddComponent<XStreamIO.BDGChat.BDGChatClient>();
chat.AppId = "app_xxxxxxxx";
chat.PlayerToken = playerJwtFromYourGameServer;
chat.Connected += () => chat.Join("lobby");
chat.ChatReceived += (text, name, id, ts, room) => Debug.Log(name + ": " + text);
chat.ConnectToChat();

Mint tokens with BDGPlayerTokens.Mint(appId, sk_live_..., displayName) on your game server only.

Overview

Live Chat API has two channels:

Base URLs

ChannelURL
HTTPS APIhttps://aponteplace.io
WebSocketwss://aponteplace.io/ws

1. Register a studio account

POST /register
Content-Type: application/json

{
  "email": "dev@studio.com",
  "password": "your-password",
  "display_name": "Studio"
}

Returns a developer JWT, and a Default app. The secret is shown once.

{
  "token": "eyJ...",
  "user_id": 1,
  "email": "dev@studio.com",
  "display_name": "Studio",
  "plan": "free",
  "is_paid": false,
  "app": {
    "public_id": "app_xxxxxxxx",
    "name": "Default",
    "secret": "sk_live_..."
  }
}

2. Login

POST /login
Content-Type: application/json

{ "email": "dev@studio.com", "password": "your-password" }

Same shape as register, plus apps[]. Use the JWT as Authorization: Bearer ….

3. Account

GET /me
Authorization: Bearer DEVELOPER_JWT

Returns plan, is_paid, and apps[]. A Default app is created if you have none.

4. Apps

GET  /apps
POST /apps
Authorization: Bearer DEVELOPER_JWT

{ "name": "Raid Game" }

POST returns public_id and secret once. Plan limits cap how many apps you can create.

5. Player tokens

Your game server mints these. Do not put sk_live_... in a shipped game client.

POST /apps/app_xxxxxxxx/player-tokens
Authorization: Bearer DEVELOPER_JWT
  or Authorization: Bearer sk_live_...

{
  "display_name": "PlayerOne",
  "player_id": "steam_123"
}
{
  "token": "eyJ...",
  "app_id": "app_xxxxxxxx",
  "player_id": "steam_123",
  "display_name": "PlayerOne"
}

6. Join a room

const ws = new WebSocket("wss://aponteplace.io/ws");
ws.onopen = () => {
  ws.send(JSON.stringify({
    type: "join",
    room: "lobby",
    app_id: "app_xxxxxxxx",
    token: PLAYER_JWT
  }));
};

Studio A’s lobby is not Studio B’s lobby. Join requires app_id.

WebSocket messages

InBody
joinroom, app_id, token
chattext
leave
typingis_typing
ping
dmto, text
OutMeaning
joinedYou are in the room; includes users_online
chatA message
user_joined / user_leftPresence
errorcode + message

Common errors: auth_required, invalid_token, app_required, app_not_found, app_mismatch, app_forbidden.

CORS

Browser calls from this site are allowed. Access-Control-Allow-Origin: *.