Audit | Node.js SDK
The audit API is designed for recording a trail of application-based user activity in a scalable, tamper-proof log.
Log an entry
log(event: Event, options: LogOptions): Promise<PangeaResponse<LogResponse>>Create a log entry in the Secure Audit Log.
const auditData = {
action: "add_employee",
actor: user,
target: data.email,
status: "error",
message: `Resume denied - sanctioned country from ${clientIp}`,
source: "web",
};
const logResponse = await audit.log(auditData);
Results of a search
results(id: string, limit: number, offset: number, options: SearchOptions): Promise<PangeaResponse<ResultResponse>>Fetch paginated results of a previously executed search.
const response = await audit.results(
"pas_sqilrhruwu54uggihqj3aie24wrctakr",
50,
100
);
Tamperproof verification
root(size: number): Promise<PangeaResponse<RootResult>>Returns current root hash and consistency proof.
const response = audit.root(7);
Search the log
search(query: string, queryOptions: SearchParamsOptions, options: SearchOptions): Promise<PangeaResponse<SearchResponse>>Search for events that match the provided search criteria.
const response = await audit.search(
"add_employee:Gumby"
);