Skip to content

Mod API Documentation

Reference docs for everything a mod can do. Mirror of the editor’s internal mod-api documentation, published here so authors can browse without needing the editor source.

Documents

DocumentWhat you’ll learn
getting-started.mdWrite your first mod in five minutes
publishing.mdHands-on walkthrough (build, release, submit your first mod, ~25 min) + full publishing reference
api-reference.mdEvery method, type, and ctx surface available to mods
events-reference.mdEvery event the editor emits, with payload shapes
quick-reference.mdOne-page cheat sheet for common API calls
api-changelog.mdWhat changed in each API version
troubleshooting.mdCommon problems and how to fix them
mod-api.d.tsTypeScript type definitions — drop into your project for IDE autocomplete
app-strings.jsonEvery translatable editor string, empty-valued — the template for a translation mod

Publishing your mod through the Marketplace? See publishing.md — it starts with a hands-on tutorial, then the full reference.

Using mod-api.d.ts in your mod project

If you write your mod in TypeScript (or use VS Code with JS type-checking), grab mod-api.d.ts from this folder and reference it for full autocomplete on ctx:

index.js
/** @param {import("./mod-api").ModContext} ctx */
export function activate(ctx) {
ctx.ui.showToast({ message: "typed!" }); // ← autocomplete works
}

Or for TypeScript:

index.ts
import type { ModContext } from "./mod-api";
export function activate(ctx: ModContext): void {
ctx.ui.showToast({ message: "typed!" });
}

The file is a single self-contained .d.ts with no dependencies. Copy it next to your index.js / index.ts.

API versioning

manifest.json#apiVersion is the minimum Mod API your mod needs — the version that introduced the newest method, event, or field it uses. Every API change gets a new version (patch included), and an editor that doesn’t provide the version you ask for refuses the mod up front: blocked in the Marketplace, error in the Mod Manager. So your mod never half-loads against an editor that lacks what it calls, and targeting an older version stays safe forever. See api-changelog.md for what each version added.

Reporting doc bugs

Open an issue on this repo if a doc is wrong, outdated, or missing something. Doc fixes are welcome via PR.