Install
One package, one dependency, no configuration. It runs in Node 20 or newer and in the browser,
needs no API key and makes no network calls — the game data is in the package. This site is built
against thetowersdk@0.11.0.
npm install thetowersdkPinning A Version
Game numbers change when the game does. Install an exact version when you want them frozen, and upgrade deliberately after a patch.
npm install thetowersdk@0.11.0 --save-exactWhat A Version Means
Below 1.0 the version is a build marker, not a compatibility promise. Any release may rename or remove an export, and data values change when the game does. That is why the line above pins an exact version rather than a range.
From 1.0 the numbers start meaning what you would expect:
- Patch — fixes, new extractors, additive data.
- Minor — data updated for a new game version; existing values may change.
- Major — breaking API changes.
The promise covers every entry point; there is no path past them to fall outside it.
Your First Lines
Nothing to initialise — import a catalog and read it.
import { LAB_CATALOG } from 'thetowersdk/data'
import { formatNumberForDisplay } from 'thetowersdk/formatting'
const lab = LAB_CATALOG.find((entry) => entry.name === 'Attack Speed')
const total = lab.levels.reduce((sum, level) => sum + level.cost, 0)
console.log(lab.levels.length, 'levels')
console.log(formatNumberForDisplay(total), 'coins to max')The Entry Points
Fifteen entry points, imported by name. Nothing is bundled that you do not import, so a tool that only needs catalogs does not carry the save reader.
| Import | What it holds |
|---|---|
thetowersdk/data | Every catalog — labs, workshop, modules, cards, relics, bots, guardians, ultimate weapons, vault, perks, tiers, milestones. Docs |
thetowersdk/mechanics | 914 formulas — enemy scaling, timing, costs, damage reduction, Effective Paths. Docs |
thetowersdk/builders | Fifteen builders that describe their own inputs. Docs |
thetowersdk/save | Extractors over a decoded save — runs, labs, cards, modules, bots, vault. Docs |
thetowersdk/node | Decoding playerInfo.dat bytes. Node only. Docs |
thetowersdk/save-decoder | The same save reader with no Node imports, for decoding in a browser tab. Docs |
thetowersdk/contributions | The roster of whose work this package carries, as data you can render. Docs |
thetowersdk/charts | 48 chart datasets, each a finished table. Docs |
thetowersdk/knowledge | The mechanics graph and five years of patch notes. Docs |
thetowersdk/wiki | Community wiki pages as Markdown. Docs |
thetowersdk/sheets | Google Sheets reading and writing, A1 helpers. Docs |
thetowersdk/bot | Every calculator as a chat command. Docs |
thetowersdk/formatting | Numbers, durations, multipliers and rates in the game's own notation — read and written. Docs |
thetowersdk/assets | Naming rules for artwork you supply yourself, so a tool can find a file in a directory of art you already have. |
TypeScript
Types ship with the package, so there is no @types to add. Every catalog and every result
is typed, which means your editor can list a mechanic's stats without you opening the docs.
import type { PatchNote } from 'thetowersdk/knowledge'
// Autocomplete knows the fields, and a typo is a compile error.
function summarise(note: PatchNote) {
return `${note.postedAt.slice(0, 10)} ${note.version ?? '—'} ${note.title}`
}In The Browser
Everything except thetowersdk/node runs in a browser bundle. The package is marked
side-effect free, so a bundler drops what you do not use — import the one catalog you need rather
than the whole of data if size matters.
// Reading a save in the browser: decode the bytes from a file input,
// then use the same extractors.
import { listImportableBattleRuns } from 'thetowersdk/save'What Else You Might Add
None of these are required. The SDK works on its own.
- The MCP server already ships inside the package — register it and your editor's assistant can query the catalogs while it writes. MCP docs
toweraiif you want an assistant of your own, plus a model key. TowerAI docsadb-bridgeif your tool reads saves from a phone or emulator. Your users run it; it is not a dependency of your project. Save docs