Docs/React UI

Find the framework route, component prop, SDK method, or HTTP contract you need.

Audit components

Render a viewer-scoped event timeline, filters, and event details. The shared provider fetches through your proxy, which supplies the viewer identity.

Filters, timeline, and details

function AuditTrail() {
 const [filters, setFilters] = useState({
  components: ["schedules", "approvals", "bulk"],
 })
 const [selected, setSelected] = useState<AuditEvent>()

 return (
  <>
   <AuditFilters value={filters} onChange={setFilters} />
   <AuditTimeline filters={filters} onSelect={setSelected} />
   {selected && <AuditEventDetails event={selected} />}
  </>
 )
}

Component reference

ComponentRequired propsOptional props and behavior
AuditFilters value? or defaultValue?, onChange?(filters), className?. Controlled when value is supplied; otherwise owns state initialized from defaultValue.
AuditTimeline filters, pageSize=25, onSelect, renderItem, className, and AsyncViewProps.
AuditEventDetails event or eventId className?, loading?, error?. Passing event avoids a request. Shows actor, source, subject, visibility, and collapsible JSON data.

ListAuditEventsParams

AuditTimeline and the hooks accept every field below. The rendered AuditFilters control currently edits only component, typePrefix, and since, plus a Clear button; provide your own controls for exact type, actors, subjects, until, or pagination.

FilterTypeMeaning
component string? One component.
components string[]? Multiple components, sent as a comma-separated REST value.
type / typePrefix string? Exact event type or namespace prefix.
actorId string? Direct server queries only for arbitrary actors.
subjectType / subjectId string? Filter around an application resource.
viewerId string? Direct server queries only; browser proxy overwrites it from context.user.id.
since / until ISO-8601 string? Inclusive time window filters.
limit / cursor number / string Cursor pagination controls.

Hooks

useAuditEvents(params?: ListAuditEventsParams)

Queries the viewer-aware chronological event page.

Returns AsyncState<Page<AuditEvent>>

useAuditEvent(id?: string)

Loads one event by ID.

Returns AsyncState<AuditEvent | undefined>

Create manual events with useIncld().client.auditEvents.create() or through your server SDK. The browser proxy injects the current user as actor.

Audit has no React mutation hook

Audit UI exports list and get hooks only. Call the provider client directly for a browser-authorized manual event, or prefer a trusted server SDK when the event records a server-side outcome. Manual writes require Audit access, which unlocks with any paid component.

Generated TypeScript signatures

InterfacePropTypeRequired
AuditEventDetailsProps extends AsyncViewProps eventId string No
AuditEventDetailsProps extends AsyncViewProps event AuditEvent No
AuditEventDetailsProps extends AsyncViewProps className string No
AuditFiltersProps value ListAuditEventsParams No
AuditFiltersProps defaultValue ListAuditEventsParams No
AuditFiltersProps onChange (filters: ListAuditEventsParams) => void No
AuditFiltersProps className string No
AuditTimelineProps extends AsyncViewProps filters ListAuditEventsParams No
AuditTimelineProps extends AsyncViewProps pageSize number No
AuditTimelineProps extends AsyncViewProps onSelect (event: AuditEvent) => void No
AuditTimelineProps extends AsyncViewProps renderItem (event: AuditEvent) => ReactNode No
AuditTimelineProps extends AsyncViewProps className string No