Site-owner worker install
Optional worker for verified site owners. It reports AI agent visits to Lyrenth from your CDN edge (GPTBot, ClaudeBot, PerplexityBot, and the rest), so Lyrenth sees the full picture of who's reading your site, not just the agents that route through our API. Install at your CDN edge in 5-10 minutes.
The worker is a transparent pass-through. It forwards every request to your origin unmodified, observes the User-Agent in the background via waitUntil(), and ships aggregated counts to Lyrenth on a 30-second batched flush. A Lyrenthoutage looks like "no new bot data appears in my dashboard," never "my site is down."
Verify your domain on Lyrenth
Get your ingest token
/sites/<your-domain>/settings on the Lyrenth dashboard. The token is in the "Ingest token" panel; click the eye icon to reveal it, then the copy button. Looks like aiwt_ followed by 32 hex characters. Keep it private; rotate from the same panel if it ever leaks.Pick the integration that matches your host
Cloudflare Worker
Sites on Cloudflare (any origin host)
- Captures HTTP response status code (404 / 5xx breakdowns work)
- Independent of customer's framework
- Cron trigger option for quiet sites
- Requires a Cloudflare account + wrangler CLI
Vercel Edge Middleware
Sites on Vercel running Next.js
- Drops into your existing project root
- Deploy via git push, no CLI tooling
- Env vars set in Vercel project settings
- Doesn't observe response status (middleware fires before route renders)
- Requires a Next.js project
Cloudflare Worker
For sites with DNS on Cloudflare. The worker proxies every request at the CF edge before it reaches your origin.
Get the template
integrations/cloudflare-worker/ from the Lyrenth repo (or build your own following the same shape). The directory includes worker.js, a wrangler.toml template, and a README with the local-dev workflow.Customize wrangler.toml
name = "lyrenth-bot-traffic"
main = "worker.js"
compatibility_date = "2026-05-09"
[vars]
LYRENTH_DOMAIN = "your-domain.com"
routes = [
{ pattern = "your-domain.com/*", zone_name = "your-domain.com" },
{ pattern = "*.your-domain.com/*", zone_name = "your-domain.com" },
]The two route patterns cover the apex and any subdomain. If you only want bot tracking on a specific subdomain, narrow the routes accordingly.
Set the ingest token as a secret
wrangler.toml(it's in your git history). Use Cloudflare's secret management:wrangler login wrangler secret put LYRENTH_INGEST_TOKEN # Paste the aiwt_... token when prompted
Deploy
wrangler deploy
Within minutes, traffic to your domain flows through the worker. Tail logs in real time with wrangler tailif something doesn't look right.
Vercel Edge Middleware
For sites already on Vercel running Next.js. The middleware lives inside your existing project and deploys on the next git push.
Copy the template
integrations/vercel-edge/middleware.ts from the Lyrenth repo to your project root (or src/middleware.ts if you have a src/ layout).Already have a middleware.ts? See Path B in the integration README; it walks through pulling our helpers into lib/lyrenth-ingest.ts and invoking from your existing middleware.
Set env vars in Vercel
LYRENTH_DOMAIN=your-domain.com LYRENTH_INGEST_TOKEN=aiwt_<your-token> # optional, only if running self-hosted Lyrenth: # LYRENTH_INGEST_URL=https://www.lyrenth.com
Apply to all environments (Production, Preview, Development) so middleware works on every deployment.
Push
git add middleware.ts git commit -m "add lyrenth bot-traffic middleware" git push
Vercel auto-deploys. Within minutes, real bot traffic to your site flows into Lyrenth's internal view, used to round out the picture of who's reading your content.
Verify it's working
Hit your site with a bot User-Agent from any machine, then check the dashboard.
curl -A "Mozilla/5.0 (compatible; GPTBot/1.0)" \ https://your-domain.com/
Within 30 seconds the ingest endpoint records the bot visit (bot_name="gptbot", category="ai_crawler"). The data feeds Lyrenth's internal view of who's reading your site; it doesn't change anything in your dashboard view.
Privacy
What the worker observes
- Request User-Agent string (sent to Lyrenth)
- Request path (query string stripped)
- Response status code (Cloudflare worker only)
What it does NOT observe
- Request body / form data
- Response body
- User cookies or auth tokens
- Visitor IP addresses
- Browser fingerprints
Path query strings are stripped client-side at the worker AND again server-side as defense in depth, since query parameters often carry session tokens, search terms, or PII. If your privacy policy specifies what edge processing happens for visitors, you should disclose this worker's existence and the categories above.
Get the ingest token first
Verify your domain on Lyrenth, then grab the token from the domain's settings page.