Overview
The Audit Log Viewer can be used to search, view, and verify tamperproofing of all logs stored by the Secure Audit Log service. It allows users to perform searches, navigate through pages of results, and interact with the audit log data.
If your application uses the Pangea Audit Service and needs to present logs within an end application, this viewer is for you. We provide the same component used within the Pangea Console as an npm package so it can be embedded directly into your React app.
The AuditLogViewer
component is built with Material-UI, consistent with the styling in the Pangea Console.
GitHub Repository & Local Storybook
All source code for this component is available on GitHub. There, you can also run a local Storybook environment to explore live examples of the component in various configurations—such as verifying tamperproof logs, customizing the schema, or applying themed styling.
Pangea's Secure Audit Log
To learn more about integrating, configuring, and using Pangea's Secure Audit Log Service, see our Secure Audit Log Documentation.
Demo
Below is a quick demo rendering of the AuditLogViewer
component. This demo is not connected to any Secure Audit Log APIs. For a real-world demonstration, see how the component is used within the Pangea Console.
Rows per page:
20
Basic Usage
import React from "react";
import {
Audit,
AuditLogViewer,
} from "@pangeacyber/react-mui-audit-log-viewer";
const MyComponent: React.FC = () => {
// IMPORTANT: 'api.searchAuditLogs' below is expected to call your *server* endpoint,
// which then contacts Pangea. Avoid embedding your Pangea service token directly in the client.
const handleSearch = async (body: Audit.SearchRequest) => {
// POST 'body' to your server's /search proxy, not to Pangea directly
const response = await api.searchAuditLogs(body);
return response;
};
const handlePageChange = async (body: Audit.ResultRequest) => {
// Similarly, call your server's /results proxy
const response = await api.getAuditLogResults(body);
return response;
};
return (
<AuditLogViewer
initialQuery="message:testing"
onSearch={handleSearch}
onPageChange={handlePageChange}
/>
);
};
Security Note: You should not expose your Pangea service token in client-side code. Always route calls through your backend for proper token security.
Advanced Examples
Below are some short code snippets illustrating common configurations. For fully interactive demos, refer to the local Storybook in our GitHub repo.