402Revnuvo/ developersGitHub

Getting started

Everything you need to accept or make your first x402 payment on Revnuvo.

1. Install the SDK

npm install @revnuvo/x402

2. Make your first paid request

import { buildXPaymentHeader } from "@revnuvo/x402";

const res = await fetch("https://assess.revnuvo.site/assess/domain", {
  method: "POST",
  body: JSON.stringify({ domain: "example.com" }),
});
const challenge = await res.json(); // 402 with a signed quote

const xPaymentHeader = await buildXPaymentHeader({ challenge, privateKey });
// retry the same request with X-Payment: xPaymentHeader

3. Protect your own API

See the Gateway page for the full request/settlement sequence.

Examples

Cloudflare Workercoming soon
Node.jscoming soon
Next.js API routecoming soon
Express middlewarecoming soon