{"_id":"@aeolens/next","_rev":"4-4e4754be657f1d6946a8a715567783a3","name":"@aeolens/next","dist-tags":{"latest":"0.2.2"},"versions":{"0.1.0":{"name":"@aeolens/next","version":"0.1.0","keywords":["aeolens","next.js","middleware","ai","crawler","analytics","gpt","claude","perplexity"],"author":{"name":"aeolens"},"license":"MIT","_id":"@aeolens/next@0.1.0","maintainers":[{"name":"nexlr","email":"contact@nexlr.in"}],"homepage":"https://aeolens.ai/docs","bugs":{"url":"https://github.com/aeolens/aeolens/issues"},"dist":{"shasum":"5aadd374f4e0dd5288a00abbaa99269c1a5a342b","tarball":"https://registry.npmjs.org/@aeolens/next/-/next-0.1.0.tgz","fileCount":6,"integrity":"sha512-tZ2gGoo4EOUigCucCAAYRifEgDOixBTvAGh6SZRYupBM38OZfWhetbX7YYGH5DAAgkdG3gLXg9UvasQIYZ8mfw==","signatures":[{"sig":"MEQCIAUxcAe7vGCoDUq68e3jNvesAb3hXlA9perZ4NBhyc0XAiACHuGS90ad2uOm5MCteXqeaFhOE07BQdll16dFrOwdfQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13252},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"build":"tsup src/index.ts --format esm,cjs --dts --clean --external next","build:ci":"tsup src/index.ts --format esm,cjs --dts --external next","typecheck":"tsc --noEmit"},"_npmUser":{"name":"nexlr","email":"contact@nexlr.in"},"repository":{"url":"git+https://github.com/aeolens/aeolens.git","type":"git","directory":"packages/aeolens-next"},"_npmVersion":"10.9.3","description":"Zero-latency AI crawler tracking for Next.js — AEOlens middleware integration","directories":{},"_nodeVersion":"22.19.0","_hasShrinkwrap":false,"devDependencies":{"next":"^14.0.0","tsup":"^8.0.0","typescript":"^5.0.0","@types/node":"^20.0.0"},"peerDependencies":{"next":">=13.0.0"},"peerDependenciesMeta":{"next":{"optional":false}},"_npmOperationalInternal":{"tmp":"tmp/next_0.1.0_1781377599843_0.13885868374499077","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@aeolens/next","version":"0.2.0","keywords":["aeolens","next.js","middleware","ai","crawler","analytics","gpt","claude","perplexity"],"author":{"name":"aeolens"},"license":"MIT","_id":"@aeolens/next@0.2.0","maintainers":[{"name":"nexlr","email":"contact@nexlr.in"}],"homepage":"https://aeolens.ai/docs","bugs":{"url":"https://github.com/aeolens/aeolens/issues"},"bin":{"next":"dist/cli.cjs","aeolens-next":"dist/cli.cjs"},"dist":{"shasum":"f75bcc88a7bcbd37f0c4d5651f5fabb2e5f4c7d7","tarball":"https://registry.npmjs.org/@aeolens/next/-/next-0.2.0.tgz","fileCount":10,"integrity":"sha512-CTLqQJxCZA1Xh8Ptdc8ObfHlIGP4t4NS1uliWRwNJLRqclE01+WKidjWFtN4EY2IssdvTLyfuJpHDVbcJyFbEg==","signatures":[{"sig":"MEUCIB6nPXKd1TjUmb6oKppRIDG7oLI7IvxhtIyjBZzVjv48AiEA0SVisSABMWAQvo7nMBOTRBCuvD4s8MIofVFm1g9tfPE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":24474},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"build":"tsup src/index.ts src/cli.ts --format esm,cjs --dts --clean --external next","build:ci":"tsup src/index.ts src/cli.ts --format esm,cjs --dts --external next","typecheck":"tsc --noEmit"},"_npmUser":{"name":"nexlr","email":"contact@nexlr.in"},"repository":{"url":"git+https://github.com/aeolens/aeolens.git","type":"git","directory":"packages/aeolens-next"},"_npmVersion":"10.9.3","description":"Zero-latency AI crawler tracking for Next.js — AEOlens middleware integration","directories":{},"_nodeVersion":"22.19.0","_hasShrinkwrap":false,"devDependencies":{"next":"^14.0.0","tsup":"^8.0.0","typescript":"^5.0.0","@types/node":"^20.0.0"},"peerDependencies":{"next":">=13.0.0"},"peerDependenciesMeta":{"next":{"optional":false}},"_npmOperationalInternal":{"tmp":"tmp/next_0.2.0_1781409098544_0.45465209133649576","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@aeolens/next","version":"0.2.1","keywords":["aeolens","next.js","middleware","ai","crawler","analytics","gpt","claude","perplexity"],"author":{"name":"aeolens"},"license":"MIT","_id":"@aeolens/next@0.2.1","maintainers":[{"name":"nexlr","email":"contact@nexlr.in"}],"homepage":"https://aeolens.ai/docs","bugs":{"url":"https://github.com/aeolens/aeolens/issues"},"bin":{"next":"dist/cli.cjs","aeolens-next":"dist/cli.cjs"},"dist":{"shasum":"147b1820803589a60a4816f38e5ddadede140a29","tarball":"https://registry.npmjs.org/@aeolens/next/-/next-0.2.1.tgz","fileCount":10,"integrity":"sha512-/SrkFXEib4sC6+fUXQWbXU4HbZmMkzTPpufqtefL29e06dywjhr+yQvT2yb1Dt5SAxNlGJp8V2K0YPrroYXeQA==","signatures":[{"sig":"MEUCIFZpccPlHnEtLoLZAxAsfJPbjya7lSMUiHmrccT5rKZEAiEAhCEsOZ7kNosv1gbolhpyAp9SS4e1bCFyz+sy2nDlD1U=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26990},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"build":"tsup src/index.ts src/cli.ts --format esm,cjs --dts --clean --external next","build:ci":"tsup src/index.ts src/cli.ts --format esm,cjs --dts --external next","typecheck":"tsc --noEmit"},"_npmUser":{"name":"nexlr","email":"contact@nexlr.in"},"repository":{"url":"git+https://github.com/aeolens/aeolens.git","type":"git","directory":"packages/aeolens-next"},"_npmVersion":"10.9.3","description":"Zero-latency AI crawler tracking for Next.js — AEOlens middleware integration","directories":{},"_nodeVersion":"22.19.0","_hasShrinkwrap":false,"devDependencies":{"next":"^14.0.0","tsup":"^8.0.0","typescript":"^5.0.0","@types/node":"^20.0.0"},"peerDependencies":{"next":">=13.0.0"},"peerDependenciesMeta":{"next":{"optional":false}},"_npmOperationalInternal":{"tmp":"tmp/next_0.2.1_1781410780552_0.7968988904025489","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@aeolens/next","version":"0.2.2","description":"Zero-latency AI crawler tracking for Next.js — AEOlens middleware integration","keywords":["aeolens","next.js","middleware","ai","crawler","analytics","gpt","claude","perplexity"],"homepage":"https://aeolens.ai/docs","repository":{"type":"git","url":"git+https://github.com/aeolens/aeolens.git","directory":"packages/aeolens-next"},"bugs":{"url":"https://github.com/aeolens/aeolens/issues"},"author":{"name":"aeolens"},"license":"MIT","type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"bin":{"aeolens-next":"dist/cli.cjs","next":"dist/cli.cjs"},"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"build":"tsup src/index.ts src/cli.ts --format esm,cjs --dts --clean --external next","build:ci":"tsup src/index.ts src/cli.ts --format esm,cjs --dts --external next","typecheck":"tsc --noEmit"},"peerDependencies":{"next":">=13.0.0"},"peerDependenciesMeta":{"next":{"optional":false}},"engines":{"node":">=18"},"devDependencies":{"@types/node":"^20.0.0","next":"^14.0.0","tsup":"^8.0.0","typescript":"^5.0.0"},"_id":"@aeolens/next@0.2.2","_nodeVersion":"22.19.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-pLPbw0ZceGq1AswaiwU/Ju+xN4WR5BY0UlO0TXnBUbxbQLK+djHeB3EiHyeV1JFrY9NdL3MBANlSYhzt6pWKWQ==","shasum":"d7e0987157d71d5766d61de69ee58e06a506a21c","tarball":"https://registry.npmjs.org/@aeolens/next/-/next-0.2.2.tgz","fileCount":11,"unpackedSize":27790,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCRQgdjAXX/Do9djHVwQv9O90y4UGqC8gZ75i1ofOlbNAIgV9pmvvhpPWGcKi0Dwd5M6YhgkFJl/jr5sP0n8ZQ0X5g="}]},"_npmUser":{"name":"nexlr","email":"contact@nexlr.in"},"directories":{},"maintainers":[{"name":"nexlr","email":"contact@nexlr.in"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/next_0.2.2_1781411767891_0.5610671566667382"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-13T19:06:39.680Z","modified":"2026-06-14T04:36:08.211Z","0.1.0":"2026-06-13T19:06:40.025Z","0.2.0":"2026-06-14T03:51:38.673Z","0.2.1":"2026-06-14T04:19:40.708Z","0.2.2":"2026-06-14T04:36:08.057Z"},"bugs":{"url":"https://github.com/aeolens/aeolens/issues"},"author":{"name":"aeolens"},"license":"MIT","homepage":"https://aeolens.ai/docs","keywords":["aeolens","next.js","middleware","ai","crawler","analytics","gpt","claude","perplexity"],"repository":{"type":"git","url":"git+https://github.com/aeolens/aeolens.git","directory":"packages/aeolens-next"},"description":"Zero-latency AI crawler tracking for Next.js — AEOlens middleware integration","maintainers":[{"name":"nexlr","email":"contact@nexlr.in"}],"readme":"# @aeolens/next\n\nZero-latency AI crawler tracking for Next.js. Detects visits from GPT, Claude, Perplexity, Gemini, and 20+ other AI crawlers and reports them to [AEOlens](https://aeolens.ai) — without adding any latency to your site.\n\n## How it works\n\nThe middleware runs at the edge, checks the `User-Agent` header on every request, and fires a fire-and-forget beacon to AEOlens if an AI crawler is detected. Your users never wait for the beacon — it runs in the background after the response is sent.\n\n## Quick start\n\n```bash\nnpx @aeolens/next init\n```\n\nThat's it. The CLI creates `middleware.ts` and writes your API key to `.env.local`. Deploy and AI crawler visits appear in your [AEOlens dashboard](https://aeolens.ai/agent-analytics).\n\nGet your API key from [AEOlens → Settings → Integrations](https://aeolens.ai/settings/integrations).\n\nNeed to change your API key? Run:\n\n```bash\nnpx @aeolens/next init --reset-key\n```\n\n## Manual setup\n\nIf you prefer to set things up yourself:\n\n```bash\nnpm install @aeolens/next\n```\n\n**1. Add your API key to `.env.local`:**\n\n```bash\nAEOLENS_KEY=aa_your_key_here\n```\n\n**2. Create `middleware.ts` in your project root:**\n\n```ts\nimport { withAEOlens } from '@aeolens/next'\n\nexport const middleware = withAEOlens()\n\nexport const config = {\n  matcher: ['/((?!_next/static|_next/image|favicon.ico).*)'],\n}\n```\n\n## Composing with existing middleware\n\nIf you already have a `middleware.ts`, call `withAEOlens()` alongside your existing logic:\n\n```ts\nimport { withAEOlens } from '@aeolens/next'\nimport { auth } from './lib/auth'\nimport type { NextRequest } from 'next/server'\n\nconst tracking = withAEOlens()\n\nexport async function middleware(req: NextRequest) {\n  // Tracking runs first — non-blocking, never delays auth\n  await tracking(req)\n  return auth(req)\n}\n\nexport const config = {\n  matcher: ['/((?!_next/static|_next/image|favicon.ico).*)'],\n}\n```\n\n## Options\n\n```ts\nwithAEOlens({\n  // Explicit key — overrides AEOLENS_KEY env var\n  key: 'aa_your_key_here',\n\n  // Called when a bot is detected. Return false to skip the beacon.\n  onDetect({ bot, url, userAgent }) {\n    console.log(`${bot} visited ${url}`)\n    // return false  ← suppress beacon for this request\n  },\n})\n```\n\n## Detected crawlers\n\nGPTBot · ChatGPT-User · OAI-SearchBot · ClaudeBot · Claude-Web · anthropic-ai · PerplexityBot · Googlebot · Google-Extended · bingbot · Bytespider · DuckAssistBot · CCBot · Amazonbot · Applebot · cohere-ai · meta-externalagent · LinkedInBot · Twitterbot · and more.\n\nThe list is kept in sync with the AEOlens backend. You can also export `KNOWN_AI_BOTS` and `detectBot` from this package if you need them elsewhere.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}