Skip to main content
Not on Vercel, Cloudflare or WordPress? The Agent Edge Network is just four HTTP endpoints and a small piece of request-handling logic you drop into your own stack. This guide gives you a copy-paste snippet for Node.js, PHP and Ruby, plus how to route crawler traffic into it from nginx or Apache.
Every official drop-in — the Next.js middleware, Cloudflare Worker and WordPress plugin — is a thin wrapper around exactly the logic below. If your language isn’t listed, port the ~40 lines of pseudocode; it’s deliberately simple.

How it works

On each request you make a fast local decision, then either serve the artifact or pass through. You always fail open — if anything errors, serve your normal page.
  1. Match the User-Agent against the verified bot set. Not a known crawler → pass through.
  2. Cloaking firewall. If the bot is a search index (Googlebot/Bingbot/Applebot) → always pass through. See Cloaking firewall.
  3. Verify the IP against the crawler’s published CIDR ranges → IP_VERIFIED vs UA_ONLY.
  4. Check eligibility — verified, the purpose is enabled, and your serve mode is Live (default).
  5. Serve the pre-generated artifact for sha256(url); otherwise pass through.
  6. Report the hit to telemetry (fire-and-forget).

The endpoints

All calls send Authorization: Bearer <your edge token> (from Agent Analytics → Setup).
EndpointMethodPurpose
/api/v1/edge/botsetGETVerified crawlers: uaToken, cidrs, purpose, isSearchIndex. Cache ~1h.
/api/v1/edge/configGETserveMode (off/shadow/canary:<pct>/default) + enabledPurposes. Cache ~5m.
/api/v1/edge/artifact?u=<sha256(url)>GETThe { markdown, jsonLd, … } for one URL.
/api/v1/edge/telemetryPOST{ hits: [ … ] } — record what was crawled and served.
Base URL: https://app.trybluesky.com.

Snippets

Each snippet ships in shadow mode (log-only) — flip SERVE_MODE to "default" when you’re ready to serve. Set your edge token as the AEN_EDGE_TOKEN environment variable.
aen.js
server.js

nginx and Apache

nginx and Apache can’t verify IPs or fetch artifacts on their own — but they don’t need to. They already sit in front of an app. Two options:
Run the Node snippet as a tiny sidecar on 127.0.0.1:8788 and send only AI-crawler user-agents to it. Everything else hits your origin unchanged.
The sidecar serves the artifact for verified crawlers and, for anything it decides to pass through, proxies back to your origin. Because the UA list is only a coarse pre-filter, the sidecar still does the real IP verification and the cloaking firewall.
With mod_rewrite, route AI user-agents to a front controller that includes aen.php.
.htaccess
In aen-entry.php, run the interceptor, then fall back to rendering your normal page:
aen-entry.php

Test it

1

Trigger a real AI crawler

Open ChatGPT (or Perplexity) with browsing and ask it to look up your site.
2

Watch the hit land

The visit appears in Agent Analytics as IP_VERIFIED.
3

Go live

Flip SERVE_MODE to "default" and redeploy. See Serve modes.
Everything else — verification levels, serve modes, and offline artifact generation — behaves exactly as it does for the official drop-ins.