History

Community

An audit log, per-person undo/redo and point-in-time reads for your tables. Every change is recorded in the same transaction: who made it, the action, and the row before and after.

    npm i @pogly/spacetimedb-history

    Change history for the tables you choose. Each write made through it is recorded in the same transaction: who made it, the named action it belonged to, and the row before and after.

    On top of that you get per-person undo/redo of whole actions (with conflict detection when someone else changed the row since), point-in-time reads of a row or a whole table at any moment, and retention that cleans up old history by itself.

    • Collaborative editors and shared boards that need undo, admin tools that need to answer "who changed this and when", moderation and support tools that need to roll a row back, and any app that wants a "time slider" over its data.
    • It's a stopgap until SpacetimeDB lets modules read their own commit log natively.

    Register each table you want tracked with history.track({...}), giving it the row type, key and the five table operations. Writes made through the returned handle are recorded.

    In a reducer, history.begin(ctx, 'move note', 'board') names the action, and every tracked write after it is grouped into one undoable step. One-line wrappers expose historyUndo, historyRedo and a historyQuery procedure to clients, with the same names as the Rust and C# versions.

    Related submodules

    Relations

    Foreign keys for SpacetimeDB: restrict, cascade or set-null deletes with previews, multi-column unique constraints, orphan check and repair, and cursor and live pagination.

    Lethalchip0/wkCommunity

    Authz

    Roles, scopes and grants for multi-user modules: wildcard permissions, role inheritance, scope trees, expiring grants, invite links, an audit log and row-level security, with no privilege escalation.

    Lethalchip0/wkCommunity

    Cron

    Schedules recurring tasks in a SpacetimeDB module using calendar expressions or fixed intervals. Supports time zones, per-job arguments, failure limits, and runtime schedule changes.

    SpacetimeDB0/wk
    Submodule

    Edit details

    One short paragraph describing the submodule.

    A few bullets for scenarios where this is a good fit.

    A few short paragraphs at the conceptual level.