Repository navigation
API
dxcufgb edited this page Nov 5, 2026
·
2 revisions
For macro and module authors.
const ss = game.modules.get("dxcufgbs-session-summary").api;
ss.open(); // the Session Summary window
await ss.start(); // GM: start recording → true, or false if a session is already open
await ss.pause(true); // GM: pause (false resumes)
await ss.end(); // GM: end (asks), then export if the setting is on → { ended, exported } or false
await ss.end({ confirm: false }); // GM: the same without asking
await ss.export(); // GM: write the files now → { summary, files }, or null if nothing was written
ss.getSummary(); // the summary as it would be exported right now (null without a session)
ss.getSession(); // the recorded session itself (null without one): the module's internal record, may change-
start,pauseandendonly work for the active GM; anyone else gets a warning (startandendthen returnfalse).exportworks for any GM and also for an ended session. -
endreturnsfalsewhen nothing was ended (no open session, or the GM said no).exportedistrue(files written),false(the write failed) ornull(Export when the session ends is off). -
getSession()returns the live record the module saves in the world, not a copy, and its layout is internal; read it, don't change it. For a stable layout usegetSummary(), which matches the exported JSON (The Files). -
filesare the paths written, relative to the Data folder:session-summaries/session-014_2026-10-19.json,.md,latest.json,latest.mdandindex.json, in that order.
Hook: Hooks.on("dxcufgbs-session-summary.exported", (summary, files) => …) after the files are written (End session, Export now or export()). It runs only on the GM's client that wrote them.
The API is set during init, so it is there from setup on. The session is loaded in ready, so getSummary() returns null before that.
Hooks.once("ready", () => {
const ss = game.modules.get("dxcufgbs-session-summary")?.active ? game.modules.get("dxcufgbs-session-summary").api : null;
if (!ss) return; // Session Summary not installed or not enabled
Hooks.on("dxcufgbs-session-summary.exported", (summary, files) => console.log(summary.session.number, files));
});The files listed in files are described on The Files.
Dxcufgb's Workshop: every Foundry VTT project, video and changelog in one place · Support on Ko-fi · MIT License
Using it
On Discord
For module authors
Help