boardgame.io: A State Engine That Turns Move Functions into Multiplayer Games
State Management and Multiplayer Networking for Turn-Based Games. View-layer Agnostic: Use the vanilla JS client or the bindings for React / React Native.
At a glance
- What is it?
- boardgame.io is an MIT-licensed TypeScript engine for turn-based games that handles state, networking, and storage. It suits JavaScript developers who want multiplayer without writing transport code, but its abstractions come with trade-offs.
- Who is it for?
- Adopt boardgame.io if you are building a turn-based game in JavaScript and want to skip writing networking and storage code, especially if you use React or React Native. Skip it if your game needs real-time action, complex server-side logic beyond simple moves, or if you prefer full control over your transport layer.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 29 days ago.
- What is it written in?
- Mainly TypeScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 14, 2026, and from our analysis. They are not legal advice.
DEEP OPEN-SOURCE ANALYSIS
The Problem It Solves
Building a turn-based game is mostly plumbing. You need to define game rules, keep the board state consistent across clients, send moves over the network, and persist the game when players leave. boardgame.io collapses most of that into a single engine. The README says you write simple functions that describe how state changes when a move is made, and the engine converts that into a playable game with online multiplayer, without requiring networking or storage code. The target user is a JavaScript developer who wants to focus on game logic, not on WebSocket servers or database schemas. It is explicitly view-layer agnostic, so you can pair it with vanilla JS, React, or React Native bindings. That makes it relevant for indie game devs, hackathon projects, and teams prototyping a board game before committing to a custom backend.
How the Engine Works
The core idea is declarative state transitions. You define a game object with moves, which are pure functions that receive the current state and a move argument, and return the new state. The engine wraps that in a reducer, similar to Redux. It automatically handles the flow: a client dispatches a move, the server validates it against the current state, applies it, and broadcasts the new state to all connected clients. The README mentions state management across clients, server, and storage automatically, and realtime sync across platforms. It also includes game phases, which let you change rules and turn order per phase, and a lobby for matchmaking and game creation. The engine keeps a log of moves, and you can time travel to view the board at an earlier state. This is a significant feature because it gives you replay and debugging tools for free. The plugin system allows new abstractions, but the README does not elaborate on what plugins exist, so you would need to check the documentation for specifics.
Getting It Running
Installation is straightforward: run npm install boardgame.io in your project. The repository itself can be run locally with npm install and npm start, which launches the examples in the examples folder. The README also notes that the repository is ready for VS Code dev containers, which is convenient for contributors. To use it, you would typically define a game object with a setup function and moves, then create a client instance with the game and a board component. The documentation at boardgame.io/documentation is the primary reference; the README does not include code examples beyond installation, so you will need to consult the docs for the exact API. The examples folder in the repo is a good starting point, but the README does not list what examples are included. If you are using React, you would use the bindings, but the README only mentions they exist, not how to import them.
Where It Falls Short
The biggest limitation is that it is designed for turn-based games only. Real-time games, like action or racing games, do not fit the move-and-respond model. Even within turn-based games, the auto-generated AI is a black box. The README says AI bots are automatically generated, but it does not explain how they make decisions or how to customize them. That means you might get a bot that plays poorly or unpredictably, and you have no way to tune it without digging into the source. Another issue is the assumption that the server is authoritative. If you need to run game logic on the client for offline play or to reduce latency, the architecture may fight you. The README mentions storage is automatic, but it does not specify which storage backends are supported, so you may need to write a custom adapter for your database. Finally, the project has not had a recent release listed, and the last push is unknown. That is a risk if you need long-term maintenance or new features.
A Real Alternative: Colyseus
Colyseus is a multiplayer game server for JavaScript that also handles state sync, but it takes a different approach. Instead of defining moves as pure functions, Colyseus lets you define state schemas and communicate changes as patches. You write server-side logic in rooms, and clients receive state deltas automatically. The key difference is that Colyseus gives you more control over the server: you can handle real-time messages, not just turn-based moves, and you can integrate with any game engine, including Phaser and Unity. boardgame.io, by contrast, is opinionated about the turn-based flow and provides a higher-level abstraction. Colyseus also requires you to set up your own transport, while boardgame.io handles it for you. If your game has any real-time elements, Colyseus is a better fit. If you want pure turn-based with minimal backend code, boardgame.io is simpler.
Maintenance and License
The project is MIT licensed, which means you can use it in commercial projects with minimal restrictions, but you should read the license file to understand attribution requirements. The README points to a changelog and a roadmap, but no recent releases are listed in the provided data. That suggests the project may be in a maintenance phase, with contributions happening on GitHub but not necessarily on a regular release schedule. The repository is not archived, and the default branch is main, so it is still active in some form. However, the lack of release information is a warning sign for teams that need stable versioning. The plugin system is extensible, but that also means you may need to maintain your own plugins if the built-in ones do not cover your needs. The documentation is the main resource, and it is open to contributions, so you can improve it if you find gaps. Before adopting, check the changelog for recent fixes and the roadmap for upcoming features.
Editorial conclusion
Adopt boardgame.io if you are building a turn-based game in JavaScript and want to skip writing networking and storage code, especially if you use React or React Native. Skip it if your game needs real-time action, complex server-side logic beyond simple moves, or if you prefer full control over your transport layer. Before committing, verify the current state of the documentation and examples, since the README points to a changelog and roadmap but does not confirm recent release activity. Also check the GitHub issues for open bugs in the multiplayer or lobby features, as those are the areas most likely to cause integration pain. boardgame.io is a solid fit for prototypes and small to medium turn-based games, but treat the auto-generated AI and plugin system as starting points, not finished products.
Community notes