NetStack

Core concepts

Projects

A project is one game. It has its own subdomain, API key, Functions, global properties and team. Rooms and players never cross project boundaries.

Rooms

A room is a group of players who share state and events. Players join a room by ID, such as lobby-1 or match-4821. A room is created when the first player joins and disposed when the last one leaves. Room and player IDs use letters, numbers, underscores and hyphens, up to 64 characters.

Players

A player is identified by the ID your game supplies when joining. NetStack does not authenticate players itself, so treat the ID as a claim and let your own backend decide who may use which ID if that matters for your game.

Properties

Properties are key-value state with three scopes:

Scope Shared with Default visibility
Player One player Private to that player
Room Everyone in a room Public to the room
Global Every room in the project Readable by Functions and the dashboard

See Properties.

Functions

A Function is JavaScript that runs on the server. Your game calls it by name with arguments, and the Function reads and writes properties, broadcasts events and returns a result. Because the logic lives on the server, the client cannot bypass it. See Writing Functions.

Events

An event is a named message broadcast to everyone in a room by a Function. Clients listen for events to react to what happened, for example playing an animation when itemUsed arrives. See Events.

Transports

Clients connect over WebSocket or UDP. Both reach the same rooms and the same Functions. See Connecting your game.