SDK (Publisher)
Quick Start
Add pay-per-crawl to your Next.js site in 5 minutes.
Install
npm install nanocrawl-sdkSetup
Create one file in your Next.js project root:
// Next.js 16+ (use middleware.ts for Next.js 14-15)
import { withNanocrawl } from 'nanocrawl-sdk'
export const proxy = withNanocrawl({
sellerWallet: process.env.SELLER_WALLET,
redisUrl: process.env.REDIS_URL,
pricing: { '/blog': 0.001, '/products': 0.002 },
defaultPrice: 0.001,
freeRoutes: ['/', '/about'],
volumeTiers: [
{ after: 10, discount: 0.20 },
{ after: 50, discount: 0.40 },
],
})
export const config = { matcher: ['/((?!_next|favicon).*)'] }Environment Variables
SELLER_WALLET=0xYourWalletAddress
REDIS_URL=rediss://default:token@your-instance.upstash.io:6379Get a free Redis URL from console.upstash.com.
Deploy
Push to Vercel with SELLER_WALLET and REDIS_URL set in your project environment variables. That's it — AI crawlers now pay you per page.
What Happens
- Humans browse your site normally — zero friction, no paywall.
- AI crawlers get a
402 Payment Requiredresponse with pricing info. - Crawlers pay via Circle Nanopayments (gas-free USDC).
- Your content is served. Revenue appears on the dashboard at
/nanocrawl.