@beacon-ai/vercel
v0.1.1
Published
Track AI crawler activity on your Vercel-hosted site. Drop-in Next.js middleware from Beacon.
Maintainers
Readme
@beacon-ai/vercel
Track AI crawler activity on your Vercel-hosted site. Drop-in Next.js middleware from Beacon.
See which AI providers are crawling your site, how often, and which pages they visit. Beacon identifies 130+ AI agents and classifies them by purpose (training, search, user-initiated).
Install
npm install @beacon-ai/vercelSetup
Add to your middleware.ts:
import { beaconLogger } from '@beacon-ai/vercel'
export default beaconLogger({
apiKey: process.env.BEACON_API_KEY!,
brandId: process.env.BEACON_BRAND_ID!,
})Or wrap your existing middleware:
import { withBeacon } from '@beacon-ai/vercel'
const myMiddleware = clerkMiddleware(async (auth, request) => {
// your auth, redirects, etc.
})
export default withBeacon(myMiddleware, {
apiKey: process.env.BEACON_API_KEY!,
brandId: process.env.BEACON_BRAND_ID!,
})Set the environment variables in your Vercel dashboard:
| Variable | Description |
|----------|-------------|
| BEACON_API_KEY | Your Beacon API key (from your Beacon dashboard) |
| BEACON_BRAND_ID | Your brand ID (UUID, from your Beacon dashboard) |
What it captures
Only request metadata. Never request or response bodies.
- Timestamp
- Hostname + path
- HTTP method
- User-Agent
- IP address
- Referer
What it does NOT capture
- Request bodies
- Response bodies
- Cookies
- Auth headers
- Query parameter values (path only)
Performance
Zero impact on response latency. Logging is fire-and-forget with batched async delivery. If the Beacon endpoint is unreachable, logs are silently dropped.
Configuration
beaconLogger({
apiKey: '...', // required
brandId: '...', // required — your brand ID (UUID)
batchSize: 50, // entries to buffer before sending (default: 50)
flushInterval: 5000, // ms before flushing buffer (default: 5000)
})License
MIT
