Skip to content

Quick Start

From zero to a verified audit trail in 5 minutes — SDK-first path for Node.

Prerequisites

  • A SealTrail account — sign up free
  • An API key from the dashboard (starts with stl_live_ or stl_test_)
  • Node.js 18+ for the official SDK

Step 1: Install the SDK

Add the sealtrail package to your project:

terminal
npm install sealtrail

Step 2: Initialize the client

Store your API key in an environment variable and create a client. One instance can be reused across your whole app.

lib/sealtrail.ts
import { SealTrail } from "sealtrail";

const sealtrail = new SealTrail({
  apiKey: process.env.SEALTRAIL_API_KEY!,
});

Step 3: Log your first event

Send an event. SealTrail computes a SHA-256 hash and appends it to your chain — returning the event with its cryptographic position.

audit.ts
const event = await sealtrail.events.log({
  actor: "user_123",
  action: "document.signed",
  resource: "doc_456",
  context: { ip: "203.0.113.42" },
});

console.log(event.id);   // "evt_..."
console.log(event.hash); // "sha256:..."

What you get back

The returned event contains the stored hash, the previous hash (linking it into the chain), and its chain position:

response.json
{
  "id": "evt_01HQ8R9X4M7K3N2V6Y8Z",
  "hash": "sha256:a1b2c3d4e5f6...",
  "previousHash": "sha256:x9y8z7...",
  "chain": { "id": "chn_default", "position": 48291 },
  "timestamp": "2026-04-19T14:32:00Z"
}

Step 4: Verify integrity

Prove the event hasn't been tampered with. SealTrail re-computes the hash from the original payload and checks it against the stored value.

verify.ts
const result = await sealtrail.events.verify(event.id);

console.log(result.valid);        // true
console.log(result.chainIntact);  // true
That's it — you now have a cryptographically verifiable audit trail. Verification is non-destructive and safe to run on every request or as a periodic compliance check.
Using cURL, TypeScript (fetch), or Python?

The SDK is optional. Every endpoint is a plain REST call — here's the same flow in your language of choice.

Log an event

terminal
curl -X POST https://api.sealtrail.dev/v1/events \
  -H "Authorization: Bearer stl_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "actor": "user_123",
    "action": "document.signed",
    "resource": "doc_456",
    "context": { "ip": "203.0.113.42" }
  }'

Verify an event

terminal
curl "https://api.sealtrail.dev/v1/events/evt_abc123/verify" \
  -H "Authorization: Bearer stl_live_..."

What's next