Configuration
TheTrailproof constructor accepts options to configure the store, signing, and defaults.
Options
In-Memory Store (Default)
The simplest configuration. Events are stored in memory and lost on process exit.JSONL File Store
Events are appended to a JSONL file — one JSON object per line. The file survives process restarts.- File is created with
0o600permissions (owner read/write only) - On initialization, reads the existing file to recover
last_hashand event count - Append-only — existing lines are never modified
- Human-readable with
cat,grep, orjq
HMAC Signing
Add HMAC-SHA256 signatures to prove event provenance.signature field in the format hmac-sha256:<hex>. The hash chain works independently of signing — they’re separate integrity layers.
Default Tenant
Set a default tenant that’s applied to every event iftenant_id is not provided in the emit() call.