Skip to content

@xtandard/audit/elysia

Elysia 1.x adapter: auditPanel() to mount the panel as a plain handler, auditElysia(), a typed plugin whose API routes Eden treaty can see, and auditContext(), the request-context plugin.

import { … } from "@xtandard/audit/elysia";
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.
auditPanel Create a panel handler suitable for Elysia.mount(path, handler).
Name Summary
AuditElysiaOptions Options for auditElysia.
Name Summary
ElysiaAuditContextCtx Elysia’s request context, plus whatever the host’s own plugins derived (e.g. user).
ElysiaAuditHandler A web-standard fetch handler with core + streams + openapi() + close() attached.
Name Documented on
AuditContextOptions @xtandard/audit/bun
AuditPanelOptions @xtandard/audit