Node.js Game Server Client SDK

This is the Node.js version of the Agones Game Server Client SDK.

Check the Client SDK Documentation for more details on each of the SDK functions and how to run the SDK locally.


Download the source directly from GitHub .


  • Node.js >= 10.13.0


Add the agones dependency to package.json, replacing with the download location:

"dependencies": {
  "agones": "./lib/agones"

To begin working with the SDK, create an instance of it.

const AgonesSDK = require('agones');

let agonesSDK = new AgonesSDK();

To connect to the SDK server, either local or when running on Agones, run the async method sdk.connect(), which will resolve once connected or reject on error or if no connection can be made after 30 seconds.

await agonesSDK.connect();

To send a health check ping call health().;

To mark the game server as ready to receive player connections, call the async method ready(). The result will be an empty object in this case.

let result = await agonesSDK.ready();

Similarly shutdown(), allocate(), setAnnotation(key, value) and setLabel(key, value) are async methods that perform an action and return an empty result.

To get details of the backing GameServer call the async method getGameServer(). The result will be an object representing GameServer defined in `sdk.proto` .

let result = await agonesSDK.getGameServer();

To get updates on the backing GameServer as they happen, call watchGameServer(callback). The callback will be called with a parameter matching the result of getGameServer().

agonesSDK.watchGameServer((result) => {
	console.log('watch', result);

To mark the game server as reserved for a period of time, call the async method reserve(seconds). The result will be an empty object.

For more information, please read the SDK Overview, check out agonesSDK.js and also look at the Node.js example .