Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.prudra.dev/llms.txt

Use this file to discover all available pages before exploring further.

Event reference

Every event on the vault SSE stream shares a common envelope. Some events are fired by Prudra automatically (system events); others are fired by your server via vault.emit().

Event envelope

{
  "type":      "job.progress",
  "eventId":   "evt_clx1abc123",
  "vaultId":   "vlt_clx1abc123",
  "timestamp": "2026-04-30T09:01:00.000Z",
  "payload":   { "current": 5, "total": 10 }
}
FieldTypeDescription
typestringEvent type — system or custom
eventIdstringUnique event ID
vaultIdstringVault this event belongs to
timestampstringISO timestamp
payloadobjectEvent-specific data

System events

vault.sealed

Fired when the vault is sealed. The SSE stream closes after this event.
{
  "type":    "vault.sealed",
  "payload": {
    "vaultId":  "vlt_clx1abc123",
    "summary":  "Processed 47 items",
    "sealedAt": "2026-04-30T09:05:00.000Z"
  }
}

vault.expiring

Fired 1 hour before the vault TTL expires.
{
  "type":    "vault.expiring",
  "payload": {
    "vaultId":   "vlt_clx1abc123",
    "expiresAt": "2026-05-01T09:00:00.000Z"
  }
}

vault.expired

Fired when the vault TTL elapses and the vault is deleted.
{
  "type":    "vault.expired",
  "payload": {
    "vaultId":   "vlt_clx1abc123",
    "expiredAt": "2026-05-01T09:00:00.000Z"
  }
}

Custom events

Your server can emit any event type with any payload. Convention is to use dot-notation strings:
{
  "type":    "job.progress",
  "payload": {
    "current": 5,
    "total":   10,
    "percent": 50,
    "item":    "invoice_042.pdf"
  }
}
{
  "type":    "item.error",
  "payload": {
    "item":    "corrupt_file.pdf",
    "reason":  "parse-error",
    "skipped": true
  }
}