smidgen

Live demos

Prove HTTP 402 on your stack

Humans pay in the browser. Bots and agents hit the same URL and get a payment challenge — then unlock after USDC settle.

Agent proof — 402 → pay → retry

Copy TypeScript or Python against Next.js hard-locked article. These URLs are in Coinbase Bazaar — search smidgen, then pay with the snippet below. Same link works in a browser for humans.

Install

bash

npm i @x402/fetch @x402/evm @x402/core viem

Pay Next.js hard-locked article

ts

import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const url = "https://next-demo.smidgen.io/premium/locked";
const key = process.env.EVM_PRIVATE_KEY as `0x${string}` | undefined;
if (!key) {
  throw new Error("Set EVM_PRIVATE_KEY to a funded Base wallet (0x…)");
}

const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(key) });

const fetchWithPayment = wrapFetchWithPayment(fetch, client);

async function main() {
  const response = await fetchWithPayment(url, {
    headers: {
      Accept: "application/json, text/html;q=0.9,*/*;q=0.8",
      "User-Agent": "smidgen-agent-example/1.0",
    },
  });
  console.log("HTTP", response.status);
  console.log(await response.text());
}

main().catch((err) => {
  console.error(err);
  process.exit(1);
});

Run: EVM_PRIVATE_KEY=0x… npx tsx pay.ts

Agent pay snippets — TypeScript, Python, curl. Start for free →

Static HTML

Fixture blog — snippet paywall (browser only)

Live

Open premium article → pay with wallet

Snippet-only — no bot 402 without nginx

Publisher URL (200 without adapter)

curl -i "https://demo.smidgen.io/articles/premium-post.html"
About this demo
  1. Hosted at demo.smidgen.io — snippet blur for humans.
  2. This URL does not return HTTP 402 to bots — add nginx/adapter for that.
  3. Pay with MetaMask (Base) or Phantom (Solana) — mainnet USDC.

Next.js (easy lock)

Next middleware + snippet blur

Live

Open /premium/article → snippet paywall

curl your URL → middleware → 402

Test your URL

curl -i "https://next-demo.smidgen.io/premium/article"
About this demo
  1. Hosted at next-demo.smidgen.io — middleware + snippet.
  2. curl the Next demo URL to see HTTP 402 for bots.

Next.js (hard lock)

Teaser HTML only until paid — no full body in source

Live

Open /premium/locked → pay → full article

curl → 402; View Source shows teaser only

Test your URL

curl -i "https://next-demo.smidgen.io/premium/locked"
About this demo
  1. Same Next demo host — hard lock at /premium/locked.
  2. Unpaid responses omit the article body; paid sessions get the full page.
  3. See docs/publisher-enforcement.md for the portable contract.

WordPress

Editor paywall + content withhold + bot HTTP 402

Live

Browse /premium-demo/ → wallet checkout

curl your post URL → HTTP 402

Test your URL

curl.exe -i "https://smidgen-demo.com/premium-demo/"
About this demo
  1. Hosted WordPress demo — see integrations/wordpress
  2. View Source unpaid shows teaser only (hard lock).
  3. curl the post URL (not the smidgen gate) to see HTTP 402.

Cloudflare Worker

Optional edge proxy — not hosted; prefer origin adapters

Coming soon

Humans use origin + snippet

Worker proxy (advanced) → 402

What's coming
  1. No public edge.smidgen.io demo yet — origin adapters are the recommended path.
  2. For local: npm run edge:dev # http://localhost:8787
  3. Deploy workers/edge to Cloudflare only if you need the optional proxy.

AI agent / bot

Same publisher URL — HTTP 402, then payment-signature

Live

N/A — headless clients only

curl → 402 → retry with payment-signature → content

Agent / bot request (expect HTTP 402)

curl -i "https://next-demo.smidgen.io/premium/locked"
About this demo
  1. Copy-paste TypeScript or Python at /integrations/agents — same URL as curl.
  2. Request the publisher URL without browser Sec-Fetch headers.
  3. x402 clients parse payment-required, sign, and retry with payment-signature.
  4. Use a funded Base wallet that is not the project's payout address.