Reverse proxy

nginx

Hybrid proxy: bots → 402 on your URL; unpaid browsers → origin. For hard lock, serve empty data-x402-paywall mounts from the origin (or generate pages that way) — nginx does not strip HTML by itself.

Before you start

Replace placeholder values like smid_YOUR_PROJECT_ID and https://yoursite.com with your project ID and site origin from the dashboard.

  • A smidgen.io project — copy your project ID from the dashboard
  • Add https://yoursite.com under Allowed websites in project settings
  • Create at least one paywall rule whose path and selector match your premium content
  • Set a payout wallet (Base or Solana) to receive USDC
  • API base URL: https://smidgen.io

Browser snippet

Easy: wallet checkout via snippet.js with data-x402-paywall. Hard lock: see the Hard lock tab.

Hybrid proxy → 402

HTTP 402 + x402 payment instructions for agents

Quick setup

Create a project in the smidgen dashboard, then follow these steps on your site.

  1. Add https://yoursite.com to Allowed websites and create a paywall rule for your premium paths (example: /post/*).
  2. Paste the browser snippet on HTML pages so humans get the wallet UI.
  3. Install the hybrid nginx maps + location blocks below (bots → 402; unpaid browsers → origin HTML).
  4. Hard lock: generate origin HTML with an empty data-x402-paywall mount (no secrets in the file).
  5. curl https://yoursite.com/post/1 without a browser → expect HTTP 402.
  6. After payment the snippet sets an unlock cookie; nginx forwards it to the smidgen gate.

Personalized snippets

Open a project in the dashboard for copy-paste configs with your real project ID, API URL, and allowed origin.