NanoCrawl
SDK (Publisher)

Configuration

Full reference for all SDK options.

All Options

withNanocrawl({
  // Required
  sellerWallet: '0x...',

  // Pricing
  pricing: { '/blog': 0.001, '/products': 0.002 },
  defaultPrice: 0.001,
  freeRoutes: ['/', '/about'],

  // Volume discounts
  volumeTiers: [
    { after: 10, discount: 0.20 },
    { after: 50, discount: 0.40 },
  ],

  // Storage
  redisUrl: process.env.REDIS_URL,
  store: myCustomPaymentStore,

  // Advanced
  gatewayUrl: 'https://gateway-api-testnet.circle.com',
})
OptionTypeDefaultDescription
sellerWalletstringrequiredYour EVM wallet address
redisUrlstringprocess.env.REDIS_URLRedis connection URL
pricingRecord<string, number>Per-route prices in USDC
defaultPricenumber0.001Fallback price for unlisted routes
freeRoutesstring[][]Routes that bypass payment
volumeTiersVolumeTier[][]Volume discounts
storePaymentStoreCustom payment store (overrides Redis)
gatewayUrlstringArc TestnetCircle Gateway URL

Environment Variables

VariableDescription
SELLER_WALLETYour EVM wallet address
REDIS_URLRedis connection URL (auto-detected by SDK)

Custom Payment Store

Implement the PaymentStore interface for any backend:

import { withNanocrawl, type PaymentStore, type PaymentEvent } from 'nanocrawl-sdk'

const myStore: PaymentStore = {
  async push(event: PaymentEvent) { /* write to your DB */ },
  async list(): Promise<PaymentEvent[]> { /* read from your DB */ },
}

export const proxy = withNanocrawl({
  sellerWallet: process.env.SELLER_WALLET!,
  store: myStore,
})

Bot Detection

The SDK uses multi-signal classification to distinguish humans from crawlers:

  • Known bot user-agents (GPTBot, Claude, curl, wget, Scrapy, etc.)
  • Cooperative headers (x-nanocrawl-capable, payment-signature)
  • Missing browser headers (accept-language, sec-fetch-dest)
  • Short or empty user-agent strings

Humans are never affected.

On this page