Repository navigation
Conversation
Add a guide for anchoring hash-only Audit Trail receipts from serverless runtimes without losing the POST after the HTTP response returns. Pattern generalized from a production x402 + Audit Trail integration on Vercel: hash/sign synchronously, return the paid response, schedule anchorAuditRecord with waitUntil, log failures without failing the client, and verify afterward via IPFS / nirium-cli (free). Verified against packages/sdk AuditAnchorOptions and live GET /api/audit/info (IPFS CID, network set by the box, free beta rate-limited). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-authored-by: Edgadafi <Edgadafi@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Documents how to anchor Nirium Audit Trail receipts from a serverless runtime (Vercel Functions) without losing the IPFS POST after the HTTP response returns, using
waitUntilfrom@vercel/functions.This came out of TIA's Audit Trail integration on mainnet (x402.holatia.app). TIA currently awaits the anchor inline with an 8 s timeout; this guide documents the
waitUntilvariant so builders can keep receipts durable on serverless without adding latency to the paid response.What’s in the guide
waitUntilexample withAgent.anchorAuditRecordwaitUntilis unavailable (local Node / other hosts)GET /api/audit/info, IPFS gateway fetch, andnirium-cli verifyVerification
Checked against:
packages/sdk/src/index.ts(AuditAnchorOptions,anchorAuditRecord→POST /api/audit/log)GET /api/audit/infoon testnet and mainnet boxes (IPFS CID, network set by the box, free beta rate-limited)Files
docs/serverless-audit-waituntil.mdREADME.md(link)AI assistance
Drafted with Claude Sonnet 5.5 via Cursor; API names and node behavior were checked against the SDK and live
/api/audit/infobefore writing.