boardgame.io
boardgame.io is a JavaScript/TypeScript engine for building turn-based games by writing pure functions that describe how game state changes on each move. It automatically handles multiplayer synchronization, storage, game phases, bots, and lobby/matchmaking, with view-layer-agnostic clients including React bindings.
MITPermissive — free to use in commercial and proprietary software, with attribution.View license →
Production readiness
4/5- Actively maintainedNo commits in over a year
- No known vulnerabilitiesNo OSV advisories
- Clear, usable licenseMIT (permissive)
- Proven adoptionWidely used
- Has documentationDocumentation indexed
npm install boardgame.ioOur analysis
A turn-based game engine for JavaScript where you express game logic as reducer-style functions over a shared state object, and the framework derives a playable, networked multiplayer game from it.
When to use boardgame.io
Ideal for digital board games, card games, and other discrete turn-based experiences where you want to focus on rules rather than networking and persistence. Strong fit when targeting web/React and needing built-in features like phases, turn orders, secret state, lobby, logs/time-travel, and auto-generated bots for testing.
When not to
Poor fit for real-time action games, physics-driven or continuous-input games, and high-frequency simulations — Colyseus, Nakama, or a custom WebSocket/ECS engine handle those better. Also overkill for a purely local single-player game with no shared/networked state.
Strengths
- Declarative move/reducer model keeps game logic clean, deterministic, and testable
- Networking, state sync, and storage are handled for you — no custom server code required for basic multiplayer
- Rich domain features: phases, turn orders, secret/hidden state, undo/redo, time-travel logs, lobby/matchmaking, and bot generation
- View-layer agnostic with first-class React/React Native bindings
- Written in TypeScript with MIT license and an active example set
Trade-offs
- Scoped specifically to turn-based games; no support for real-time or continuous gameplay
- Opinionated architecture means you must structure game logic around its move/phase model
- Bundled bots are heuristic/MCTS-style and won't produce strong AI without custom work
- Scaling the multiplayer server for large concurrent loads requires additional infrastructure decisions
- Smaller niche ecosystem compared to general game engines, so fewer third-party resources
Maturity
Mature and widely adopted (12k+ stars) with documentation, a plugin system, CI/test coverage, and community channels. Development is community-driven and steady rather than fast-moving, and it is production-usable for the turn-based niche it targets.
Write simple functions that describe how the game state changes when a particular move is made. This is automatically converted into a playable game complete with online multiplayer features, all without requiring you to write a single line of networking or storage code.
Features
State Management: Game state is managed seamlessly across clients, server and storage automatically.
Multiplayer: Game state is kept in sync in realtime and across platforms.
AI: Automatically generated bots that can play your game.
Game Phases: with different game rules and turn orders per phase.
Lobby: Player matchmaking and game creation.
Prototyping: Interface to simulate moves even before you render the game.
Extendable: Plugin system that allows creating new abstractions.
View-layer Agnostic: Use the vanilla JS client or the bindings for React / React Native.
Logs: Game logs with the ability to time travel (viewing the board at an earlier state).
Usage
Installation
npm install boardgame.io
Documentation
Read our Full Documentation to learn how to use boardgame.io, and join the community on gitter to ask your questions!
Running examples in this repository
npm install
npm start
The examples can be found in the examples folder.
Using VS Code?
This repository is ready to run in a dev container in VS Code. See the contributing guidelines for details.
Changelog
See changelog.
Get involved
We welcome contributions of all kinds! Please take a moment to review our Code of Conduct.
🐛 Found a bug? Let us know by creating an issue.
❓ Have a question? Our Gitter channel and GitHub Discussions are good places to start.
⚙️ Interested in fixing a bug or adding a feature? Check out the contributing guidelines and the project roadmap.
📖 Can we improve our documentation? Pull requests even for small changes can be helpful. Each page in the docs can be edited by clicking the “Edit on GitHub” link at the top right.