Skip to content

Installation

This page covers installing the SDK, configuring the client, and verifying the connection.

Terminal window
npm install @volidator/node

The package has no runtime dependencies. It uses Node.js built-in crypto for AES-256-GCM encryption and HMAC-SHA256 blind index generation.

Add the following to your .env file or secrets manager:

Terminal window
VOLIDATOR_API_KEY= # API key from the Volidator dashboard
VOLIDATOR_ENCRYPTION_KEY= # 32-character random string you generate (64 hex chars prefixed with vol-dek-)

Generate an encryption key:

Terminal window
node -e "const b=require('crypto').randomBytes(32);console.log('vol-dek-'+b.toString('hex'))"

Keep VOLIDATOR_ENCRYPTION_KEY secret and consistent across deployments. Changing it makes all previously encrypted logs unreadable.

Create one client instance and export it. Do not create a new instance per request.

import { VolidatorClient } from '@volidator/node';
export const volidator = new VolidatorClient({
apiKey: process.env.VOLIDATOR_API_KEY!,
encryptionKey: process.env.VOLIDATOR_ENCRYPTION_KEY!,
});

The Python SDK parameters map exactly to Node.js options using idiomatic snake_case:

Node.js Name Python Name Type Required Default Description
apiKey api_key string Yes Bearer token for the ingestion worker
encryptionKey encryption_key string Yes AES-256-GCM encryption key
keyring keyring object No Map of historic key IDs to key strings for rotation
activeEncryptionKeyId active_encryption_key_id string No Active write key ID when using a keyring
endpoint endpoint string No https://ingestion.volidator.com Ingestion worker URL
projectId project_id string No Required only for generateEmbedToken()
clientSecret client_secret string No Required only for generateEmbedToken()
telemetry telemetry dict No {'preset': 'standard'} IP, user-agent, and location settings
redactKeys redact_keys list No [] Fields to redact before encryption
referenceKeys reference_keys list No [] Fields to replace with [REF:id] (JIT Hydration)
maxMetadataSize max_metadata_size number No 10240 (10KB) Max size in bytes for metadata
maxRetries max_retries number No 3 Maximum retry attempts for transient errors
onDeliveryFailure on_delivery_failure function No Callback fired when an event permanently fails
const ok = await volidator.log({
actor: 'setup-test',
action: 'connection.verify',
target: 'ingestion-worker',
});
console.log('Connected:', ok); // true = log accepted

If ok is false/False, check that VOLIDATOR_API_KEY matches an active project in the dashboard and that the ingestion worker is reachable.

If you are proxying ingestion requests through a custom gateway or domain (e.g. for private routing or compliance proxying), pass the custom endpoint option:

const volidator = new VolidatorClient({
apiKey: process.env.VOLIDATOR_API_KEY!,
encryptionKey: process.env.VOLIDATOR_ENCRYPTION_KEY!,
endpoint: 'https://logs-proxy.your-domain.com',
});
  • Quickstart — minimal working example
  • Telemetry — controlling what context data is collected