Examples

Integrate Veritio in minutes

These are real, copy-pasteable examples using the open-source SDKs. No hosted account required — everything below runs against the local, self-hostable packages.

Install

Pick the SDK for your stack. Each package ships independently.

TypeScriptbash
npm install @veritio/core
# or
bun add @veritio/core
Pythonbash
pip install veritio
Gobash
go get github.com/getveritio/veritio/sdks/go

Record your first event

Append a structured audit event to a store, then link the actor to it with an evidence edge.

audit-event.tsts
import { MemoryAuditStore, createAuditEvent, createEvidenceEdge } from "@veritio/core";

const store = new MemoryAuditStore();

const event = createAuditEvent({
  id: "evt_01",
  occurredAt: "2026-06-10T00:00:00.000Z",
  actor: { type: "user", id: "usr_123" },
  action: "org.member.invited",
  target: { type: "organization", id: "org_123" },
  scope: { tenantId: "org_123", environment: "production" },
  purpose: "access_management",
  lawfulBasis: "contract",
  retention: "security_1y",
  metadata: { inviteId: "inv_123", role: "viewer" },
});

await store.append(event);

const edge = createEvidenceEdge({
  id: "edge_01",
  occurredAt: "2026-06-10T00:00:01.000Z",
  scope: { tenantId: "org_123", environment: "production" },
  from: { type: "actor", id: "usr_123", actorType: "user" },
  relation: "created",
  to: { type: "runtime_event", id: "evt_01" },
  metadata: { reason: "member_invite" },
});

The evidence edge connects the actor (usr_123) to the recorded event in the evidence graph, capturing who did what without overwriting the original event.

Python: evidence edges

Build an evidence edge — for example, linking an AI agent session to a file it created — and produce a stable hash for that edge.

edge.pypython
from veritio import create_evidence_edge, hash_evidence_edge

edge = create_evidence_edge({
    "from": {"type": "agent_session", "id": "agt_sess_123"},
    "relation": "created",
    "to": {"type": "file", "id": "file_billing_plan", "pathHash": "sha256:..."},
    "scope": {"tenantId": "org_123", "environment": "production"},
    "metadata": {"reason": "ai_agent"},
})

edge_hash = hash_evidence_edge(edge)

Local Workbench

Run the Workbench from your terminal to explore evidence locally.

terminalbash
veritio dev --mcp

This opens a browser evidence-graph UI with a verifier, a scenario runner, and MCP tools for AI agents — all running locally, with no account needed.

Framework integrations

Shipped adapters wire evidence recording into popular frameworks with minimal glue code.

Better Auth

Record user, session, and invitation events.

Next.js

Record evidence from server route handlers and server actions.

TanStack Start

Server-side evidence recording.

SvelteKit

Server-side evidence recording.

React / Vue / Svelte

UI intent helpers that annotate the interface (no client-side recording).

See the full reference example combiningNext.js + Better Auth:examples/nextjs-better-auth →

Planned

Express, Hono, tRPC, and FastAPI adapters are planned and not yet available.

Start with the open source

Clone the repo, read the protocol, and run the examples above. Veritio provides evidence support for your audit trails — you stay in control of where it runs.