Skip to content

@xtandard/audit/react

The admin dashboard and the customer portal as React components, to embed in your own app (advanced mode). Most users mount the bundled SPA via a framework adapter and never touch React; this is for teams that want the panel inside an existing React shell.

Two components share the same SPA internals:

import { AuditDashboard, AuditPortal } from "@xtandard/audit/react";
import "@xtandard/audit/react/styles.css";
// Full admin — point it at wherever the panel API is mounted:
<AuditDashboard apiBaseUrl="/audit" />
// Customer-scoped portal — pass a portal token minted server-side:
<AuditPortal apiBaseUrl="/audit" token={portalToken} />

react and react-dom are peer dependencies in this mode. The components are self-contained otherwise (TanStack Query and styles are bundled).

import { … } from "@xtandard/audit/react";
Name Summary
AuditDashboardProps Props for AuditDashboard.
AuditPortalProps Props for AuditPortal.
Name Summary
EmbedTheme Theme modes for the embedded components (see AuditDashboardProps.theme).
Name Summary
AuditDashboard The full audit-log admin dashboard as an embeddable React component.
AuditPortal The customer-facing log viewer as an embeddable React component. Renders the same shell as AuditDashboard with the portal token attached as a Bearer credential; the server scopes every request to the token’s tenant (and its optional view filter) and the shell renders the reduced portal chrome from the first render.
getThemePref The stored preference (system when unset, invalid, or storage is unavailable).
setApiBase Point the API client at a base URL (used by the @xtandard/audit/react export).
setApiToken Attach a portal token (audpt_…) as a Bearer credential on every request.
setThemePref Persist pref and notify subscribers.
Name Documented on
default (AuditDashboard) @xtandard/audit/react