Skip to content

@xtandard/audit/elysia2

Elysia 2 adapter: the same surface as @xtandard/audit/elysia (auditPanel(), the typed auditElysia() plugin, auditContext()), built against Elysia 2 and @elysia/eden.

import { … } from "@xtandard/audit/elysia2";
Name Summary
auditContext Request-context plugin: resolves the actor / tenant from Elysia’s context (whatever your auth plugin derived) and opens an audit context scope for the handler, so every audit.record() inside it is attributed. Register it after the plugin that derives your user.
auditElysia Typed Elysia plugin exposing the API so the Eden client can call it with full path/method/param typing (client.audit.api.tenants.get()). Routes are declared for the typed surface; every handler delegates to the shared fetch pipeline (auth, authorization, portal scoping, error mapping reused). A catch-all also serves the bundled UI.
Name Summary
ElysiaAuditContextCtx Elysia’s request context, plus whatever the host’s own plugins derived (e.g. user).
Name Documented on
AuditContextOptions @xtandard/audit/bun
AuditElysiaOptions @xtandard/audit/elysia
auditPanel @xtandard/audit/elysia
AuditPanelOptions @xtandard/audit
ElysiaAuditHandler @xtandard/audit/elysia