Download the PHP package forgemesh/pay-per-crawl-drupal without Composer

On this page you can find all versions of the php package forgemesh/pay-per-crawl-drupal. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package pay-per-crawl-drupal

ForgeMesh Pay-per-Crawl for Drupal

Know who crawls your site. Charge the ones that can pay.

Pay-per-Crawl shows you every AI crawler, SEO crawler and script that fetches your pages, verifies the real search engines by reverse DNS so SEO is untouched, and lets you answer everything else with a standard HTTP 402 price in USDC on Base, paid to your own wallet. Be clear about what pays today: x402-capable agents do; the big AI labs' crawlers (GPTBot, ClaudeBot, PerplexityBot and friends) do not yet pay anyone per page, and they simply get no content from a charging site. Until they do, this is an honest bot ledger with the price already on the door. You see who takes what, you can block or charge any of it, and when a crawler does pay, it goes straight to you. Nobody in between holds the money.

This is a Drupal 10 and 11 module using x402 (v1 and v2) and MPP. Humans and verified search engines read free; bots get an HTTP 402 Payment Required until they pay.

Money flow

Cloudflare: AI Crawl Control (and any bot-fight or WAF rule that blocks AI crawlers) must be set to Allow. A crawler blocked at the edge never reaches Drupal and never sees the 402.

Install

Not yet on drupal.org or Packagist, so add the GitHub repositories:

(composer/installers places it in modules/contrib/pay_per_crawl.) Requires PHP 8.1+, Drupal 10.1+ or 11.

It starts in monitor mode: classify and log, never charge. Open /admin/config/services/pay-per-crawl, enter your Base wallet, choose Gate, save. Grant administer pay per crawl only to trusted roles.

How it gates (and why it is a middleware)

The gate is an http_middleware service at priority 250, ahead of Drupal's page cache (200). A kernel.request subscriber would never see a cached page: the page cache answers anonymous requests before the kernel event fires, so a bot would read every cached page for free. The integration suite warms the page cache and then checks a bot still gets 402 (and X-Drupal-Cache: HIT for the human warm-up proves the precondition).

The gate fails open: if it throws, the page is served and the error goes to the PHP error log.

Drupal's own plumbing (/admin/, login/reset paths, /batch, /system/, /core/, /sites/, /modules/, /themes/, /libraries/, /update.php, /install.php, /cron/, /contextual/) is never gated. Signed-in users are not exempted by cookie (a cookie is client-controlled); browsers are classified as humans and read free anyway.

Settings

Setting Notes
Mode monitor or gate. Without a valid wallet, gate is refused by the form and degrades to monitor at runtime.
Wallet, price Base address; minimum $0.005.
Who pays free / paid / block per class (search, social, monitor, seo, ai, automation, bot) plus per-crawler overrides and never-gated path prefixes (matched on a segment boundary: /pricing exempts /pricing/plans, not /pricing-secret).
Facilitator URL / auth Empty = PayAI.
Client IP header Behind a proxy, e.g. CF-Connecting-IP or X-Forwarded-For. It must be a header your proxy overwrites or appends to. For a multi-value header the right-most entry is used; a client-supplied left-most value is ignored. Never set it if the origin is reachable directly. Also configure reverse_proxy in settings.php if you terminate TLS upstream.
Canonical site URL Optional; pins payment URLs behind a rewriting proxy. Required for the Pro sync cron.
Retention Days to keep hit rows (default 90). Rows hold daily-salted IP hashes, never IPs.

The facilitator Authorization header, if you set one, lives in config: override it in settings.php ($config['pay_per_crawl.settings']['facilitator_auth']) if you export config to git.

Verification

tests/integration.sh (set APP_DIR to a Drupal project with drush and this module installed) runs the 42-check HTTP matrix (human 200, GPTBot 402 with v2 header + v1 body + MPP header, HEAD 402, discovery 200, paid v1/v2/MPP through a mock facilitator, replay 402, underpayment 402) plus 12 Drupal checks (page-cache bypass, hits table, admin form and report render, form validation).

Results at v0.1.0: Drupal 10.6.19 on PHP 8.1 (SQLite): 42/42 + 12/12. Drupal 11.4.10 on PHP 8.3 (MariaDB): 42/42 + 12/12. Core unit tests: 156 checks.

Real paid calls through PayAI against the Laravel edition of the same core (same wire code), $0.01 each, receipts verified on mainnet.base.org:

Rail Transaction
x402 v1 0xfc7d0a33ab2baeb50f91109db26d4e882e627f66c0cb68b13363a8f7b09e3b68
x402 v2 0xff1dfa134999dc4ad19bd8a9f9ae05e286e5c9e9714bc13c4979a3c073d7b63d

License

GPL-2.0-or-later (as Drupal requires). Depends on the MIT-licensed forgemesh/pay-per-crawl-core. Built by ForgeMesh Labs - [email protected]


All versions of pay-per-crawl-drupal with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
forgemesh/pay-per-crawl-core Version ^0.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package forgemesh/pay-per-crawl-drupal contains the following files

Loading the files please wait ...