@zanii/react
v0.1.0
Published
Drop-in React components that verify Zanii proofs client-side: VerifiedBadge, ProofViewer, AgentProfile, LedgerTicker. Show trust in your UI in minutes.
Readme
@zanii/react
Drop-in React components that make verifiability visible in your product — and every
one verifies client-side (via @zanii/sdk), with no backend of your own and no
trust in the server. Styles are inline, so there's nothing to import.
npm install @zanii/react @zanii/sdk reactComponents
import { VerifiedBadge, ProofViewer, AgentProfile, LedgerTicker } from '@zanii/react';
<VerifiedBadge did={agentDid} /> {/* ✓ Verified by Zanii · N proofs */}
<ProofViewer hash={receiptHash} /> {/* verifies a receipt in-browser → PROVEN / FAILED */}
<AgentProfile did={agentDid} /> {/* shareable trust card + audit-bundle download */}
<LedgerTicker /> {/* live counter: proofs · agents · anchors */}Each accepts an optional server prop (defaults to https://ledger.zanii.agency)
and a style override.
Data helpers (no React)
The verification logic is exported separately, so you can use it anywhere:
import { fetchProofStatus, fetchAgentSummary, fetchStats } from '@zanii/react';
const { ok } = await fetchProofStatus(server, hash); // client-side proof check
const summary = await fetchAgentSummary(server, did); // { receipts, revoked, … } | null
const stats = await fetchStats(server); // { receipts, agents, anchors }React 18+ peer dependency. ProofViewer/VerifiedBadge prove things without
trusting the server — the check runs in the user's browser.
Changelog
- 0.1.0 — initial release:
VerifiedBadge,ProofViewer,AgentProfile,LedgerTicker, and thefetch*data helpers.
License
Apache-2.0.
