Skip to content

Example Implementations

Every business has different compliance requirements for how Protected Health Information (PHI) and Personally Identifiable Information (PII) must be handled.

Volidator supports four distinct architectural modes. Below are complete, copy-pasteable examples for the Node.js SDK demonstrating exactly how to configure the client and trigger an audit log for each scenario.


Use Case: You are logging raw infrastructure events or system actions where no human identifiers (like emails or SSNs) are involved.

How it works: You log the raw payload. Because AES-GCM encryption is applied globally by the SDK to every payload, no special configuration is needed to secure this data. It is End-to-End Encrypted (E2EE) on your server before reaching Volidator.

import { VolidatorClient } from '@volidator/node';
// 1. Initialize standard client
const volidator = new VolidatorClient({
apiKey: process.env.VOLIDATOR_API_KEY!,
encryptionKey: process.env.VOLIDATOR_ENCRYPTION_KEY!,
});
// 2. Log the event
await volidator.log({
actor: 'system_cron_job',
action: 'database.backup.completed',
target: 'db_cluster_us_east',
metadata: {
durationMs: 4500,
bytesTransferred: 1024000
}
});