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_orstl_test_) - Node.js 18+ for the official SDK
Step 1: Install the SDK
Add the sealtrail package to your project:
npm install sealtrailStep 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.
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.
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:
{
"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.
const result = await sealtrail.events.verify(event.id);
console.log(result.valid); // true
console.log(result.chainIntact); // trueUsing 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
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
curl "https://api.sealtrail.dev/v1/events/evt_abc123/verify" \
-H "Authorization: Bearer stl_live_..."What's next
- Node.js SDK — Full API reference and types
- Authentication — API key format, scopes, and error handling
- API Reference — Query, export, and chain endpoints
- Concepts — How hash chains and verification work
- Error Handling — Error codes and retry strategies