B2B integration · middleware demo

External app → LedgerLock API

LedgerLock is a drop-in audit API, not only a dashboard. Any regulated SaaS calls POST /api/events via LedgerLockClient — the console is for compliance officers reviewing the chain.

EHR

Hospital EHR (client app)

Uses LedgerLockClient

CLI equivalent: npm run integration-demo

API

LedgerLock API

POST /api/events

Request body

{
  "tenantId": "acme",
  "actor": "ehr.integration",
  "action": "PHI_READ",
  "payload": {
    "subject": "ACME-1042",
    "view": "lab-results",
    "source": "external-ehr-v1"
  },
  "flagged": false
}

Response

// Click send — append via least-privilege IAM

Embed in your SaaS (3 lines)

import { LedgerLockClient } from "@/lib/client";

const ledger = new LedgerLockClient("https://ledgerlock-vert.vercel.app");

await ledger.appendEvent({
  tenantId: "acme",
  actor: "ehr.integration",
  action: "PHI_READ",
  payload: { subject: "ACME-1042", view: "lab-results" },
});