Skip to content

@xtandard/audit/express

Express adapter: auditPanel() bridges Node’s req/res to the web-standard panel handler (mount it before any body parser), and auditContext() opens a request-context scope around next().

import { … } from "@xtandard/audit/express";
Name Summary
auditContext Request-context middleware: resolves the actor / tenant from Express’s req (whatever your auth middleware set, e.g. req.user) and calls next() inside an audit context scope, so every audit.record() in the downstream handlers is attributed. The socket address is the IP fallback.
auditPanel Create an Express handler serving the panel. Use with app.use(path, handler).
Name Summary
ExpressAuditHandler An Express request handler with the core + streams + openapi + close attached.
Name Documented on
AuditContextOptions @xtandard/audit/bun
AuditPanelOptions @xtandard/audit