Skip to main content


Why use Rune?

Build a multiplayer game that reaches millions and let Rune handle all the complexity. Here's some things you don't have to worry about if you use Rune:

  • Netcode
  • Hosting servers
  • Accounts & friends
  • Voice chat
  • Matchmaking
  • Version mismatches
  • Conflict resolution
  • Spectating

Setting up a new project

npx rune-games-cli@latest create

Integrate with existing game

Include the following lines in your index.html file before loading any other JS scripts:

<script src=""></script>
<script src="logic.js"></script>

Game Logic

Create a file named logic.js with a setup function that returns initial values for your game state that should be synced across players. Add an action that modifies this game state and call Rune.initLogic() to initialize. For instance, to give all players a score and have an action that just increments the score:

// logic.js

minPlayers: 1,
maxPlayers: 4,
setup: (playerIds) => {
const scores = {}
for (let playerId of playerIds) {
scores[playerId] = 0
return { scores }
actions: {
incrementScore(playerWhoGotPoints, { game }) {


Next, integrate your game UI to react to game state changes and send actions to the logic layer. This code may live anywhere except in logic.js; the docs will refer to client.js:

// client.js

// Your game setup code...

// Trigger an action based on user input
button.onClick = () => {
playerWhoGotPoints: "player1",

// Callback you define for when something changes (e.g. someone made an action)
function onChange({ oldGame, newGame, yourPlayerId, players, action, event }) {
// Your game visuals update code...

// Initialize the Rune SDK once your game is fully ready
Rune.initClient({ onChange })

Next steps