Public BetaRisk models continue to evolve during validation.
TypeScript SDK v0.1

One client for campaigns, cluster intelligence, decisions and webhooks.

The SDK source is maintained as the publish-ready `@triproof/sdk` package inside the Tri-Proof repository. Package publication is a separate release step; this page does not claim that an npm release already exists.

Publish-ready package
`packages/triproof-sdk` has its own package manifest, TypeScript build configuration, declarations and prepack build.
Campaign API v2
Create durable campaigns, run cohorts, poll analyses, export decisions and change future-run policy.
Cluster intelligence
Read stored grouping basis, support confidence, inferred archetype and bounded forensic previews without recomputing decisions.
Webhook management
API Growth keys can create, inspect, pause, update and delete signed webhook endpoints through `/api/v2/webhooks`.
Delivery observability
Inspect endpoint health, page through delivery history and retry a failed persisted delivery without creating a new event.
Campaign workflow
The same campaign ID is reused across every analysis run.
const triProof = new TriProofClient({
  apiKey: process.env.TRIPROOF_API_KEY,
})

const campaign = await triProof.createCampaign({
  name: "Genesis Rewards",
  campaignType: "Airdrop",
  chain: "Base",
  riskPolicy: "balanced",
})

const run = await triProof.runCampaignAnalysis(campaign.id, {
  analysisMode: "onchain",
  wallets: [
    "0x2222222222222222222222222222222222222222",
    "0x3333333333333333333333333333333333333333",
  ],
})

const decisions = await triProof.getCampaignDecisionPackage(campaign.id)
Cluster Support Intelligence
The SDK resolves one cluster under its campaign and analysis run. Support confidence is evidence-strength telemetry, not a Sybil probability.
const runState = await triProof.getCampaignAnalysis(campaign.id, run.analysisId)
const cluster = runState.clusters?.[0]

if (cluster && typeof cluster === "object" && "clusterLabel" in cluster) {
  const intelligence = await triProof.getCampaignClusterIntelligence(
    campaign.id,
    run.analysisId,
    String(cluster.clusterLabel),
  )

  console.log(intelligence.support.score)
  console.log(intelligence.support.confidence)
  console.log(intelligence.archetype.primary.label)
}
Lifecycle and policy
Policy activation is explicit, versioned and future-facing.
await triProof.changeCampaignLifecycle(campaign.id, "paused")

await triProof.activateCampaignPolicy(campaign.id, {
  preset: "strict",
  rationale: "Higher-value reward round",
})
Webhook health and retry
Manual retry increments the same delivery attempt record and cannot replay a successful delivery.
const endpoint = await triProof.createWebhook({
  url: "https://yourapp.com/api/triproof-webhook",
  eventTypes: [
    "analysis.completed",
    "analysis.review_required",
    "decision_package.ready",
  ],
})

// Save endpoint.secret when the endpoint is created.
const endpointState = await triProof.getWebhook(endpoint.id)
console.log(endpointState.health)

const failed = await triProof.listWebhookDeliveries(endpoint.id, {
  status: "failed",
  limit: 25,
})

if (failed.deliveries[0]) {
  await triProof.retryWebhookDelivery(endpoint.id, failed.deliveries[0].id)
}
Compatibility boundary
Legacy `createAnalysis` and `getAnalysis` methods remain available for v1 one-off integrations. Cluster Support Confidence and inferred archetypes are read-only forensic interpretation layers and cannot change stored membership, wallet risk, decisions or policy. Delivery health is operational telemetry only; it is not wallet risk evidence and cannot change campaign decisions. Manual retry reuses the stored payload and secure egress path and does not create a second campaign event.