Game.players always empty Object

import dotenv from "dotenv";
import { Game } from "@gathertown/gather-game-client";
import webSocket from "isomorphic-ws";
global.WebSocket = webSocket;

const API_KEY = process.env.GATHER_API_KEY;
const GATHER_SPACE =  process.env.GATHER_SPACE;

const onConnected = (connected) => {
    console.log("Connected: ", connected);

const game = new Game(() => Promise.resolve({ apiKey: API_KEY }));
game.subscribeToEvent("playerJoined", (player) => {
    console.log("playerJoined", player);


With the above code game.players is always empty, and the event playerJoined is never emitted I tried on two separate spaces I get the same results.

The Event is "playerJoins", not "playerJoined". Otherwise it should work.

Yeah, now it seems to work, I get the correct list, very curios why Github Copilot autocompleted with Joined instead of Joins.

Just finding this, since Bill helped out :slight_smile:

I would recommend using TypeScript here where possible - our library comes with strict typing and subscribeToEvent has a union on it that will stop your code from compiling if you accidentally enter the wrong one. Also, if you haven’t seen our docs, here: