Systems and modules
A system is the base ruleset of a world: sheets, conditions, calendar, dice, initiative, vitals, currency. A module sits on top and adds to it, and a world can enable as many as it likes.
Extension API
Systems and modules are packages: a pack.json, facet files, and a script when you want one. The same pack runs in Studio, on your server, and on ours.
IQuick start
A module is a folder. Write two files, load it in Studio.
pack.jsonThe manifest names the pack, its role, what it extends, and the permissions it asks for.
{
"schemaVersion": 1,
"id": "my-first-module",
"role": "module",
"extends": "*",
"script": "./main.js",
"permissions": ["ui"]
}
main.jsA script is an ES module that takes the api object and registers what it adds.
api.hooks.on("pack.enabled", (p) => api.log("active in", p.worldId))
Zip the folder, import it in Studio, and the GM enables it with the permissions you declared.
IIThe shape of it
Four ideas carry the rest of these docs.
A system is the base ruleset of a world: sheets, conditions, calendar, dice, initiative, vitals, currency. A module sits on top and adds to it, and a world can enable as many as it likes.
Content resolves in order: the system first, then each enabled module in the order the GM set. Merging depends on the facet, so a later characterSheet replaces the earlier one while conditions merge by id.
Facets are JSON: sheets, conditions, calendars, dice, catalogs and twenty more, with no code at all. Scripts are ES modules that register behaviour through the api object when configuration is not enough.
Third-party scripts run in an isolated frame with no access to cookies, storage or the host page, and every call is checked. A pack gets exactly the permissions it declared, such as read-world or send-chat, and nothing can ask to be trusted.
The GM sets the order. Each facet merges in that order, so the last pack to declare one wins.
IIIThe library
Your first module, a tour of Studio, and building a whole system.
Bring battlemaps in, read and write .divinevtt files, export what you built.
The pack chain, character sheets, rules, scripting, effects and the sandbox.
Every surface spelled out: the api object, hooks, facets, nodes and data types.
Working packs to take apart, from the built-ins to item automation.
For AI assistants
Every page here is also served as plain Markdown: append .md to any docs URL. Point a coding assistant at the bundle, not the site.