@plumix/plugin-audit-log
v0.1.0
Published
Activity-feed audit log plugin for Plumix — captures entry, user, term, and settings events to a queryable feed.
Maintainers
Readme
@plumix/plugin-audit-log
This Plumix plugin records who did what — an activity feed of entry, user, term, and settings events, queryable from the admin.
Install
pnpm add @plumix/plugin-audit-logThen add it to your plumix.config.ts:
import { plumix } from "plumix";
import { auditLog } from "@plumix/plugin-audit-log";
export default plumix({
// …your runtime, database, and auth
plugins: [auditLog()],
});The plugin ships a database table. Regenerate migrations after adding it:
plumix migrate generateWhat you get
An
/audit-logadmin page (under Tools) — a paginated, filterable feed, gated behind anaudit_log:readcapability.Automatic capture — subscribes to entry, user, term, and settings lifecycle events; no wiring needed.
A retention purge — a daily scheduled task trims old rows (90 days by default).
ctx.audit.log(...)— record your own events from a plugin or handler:ctx.audit.log({ event: "widget.published", subject: { type: "widget", id }, properties: { name }, });
Configuration
auditLog({
// Keep entries for 90 days (the default), or pass `false` to keep forever.
retention: { maxAgeDays: 90 },
// Optional custom storage seam; defaults to the SQLite table.
// storage: sqlite(),
});Support
Have a question? Start a discussion. Found a bug? Open an issue.
Contributing
PRs and ideas welcome. The Contributing guide gets you set up — new contributors especially welcome.
License
MIT © Plumix Contributors
