How It Works
Framework middleware intercepts every incoming request before your page code runs. When an AI bot is detected, the bot’s metadata is sent to the traffic-ingest-service as a fire-and-forget background fetch — zero latency added to real user loads.Setup
1
Create the middleware file
Add the following file to the root of your project (same level as
package.json):2
Fill in your credentials
Replace the two placeholder values in the file:
3
Deploy
Commit and push (or run
vercel deploy). The middleware activates automatically on every incoming request.No additional environment variables, build steps, or packages are required.Netlify
For Netlify, use an Edge Function instead of middleware:netlify/edge-functions/bot-tracker.js
netlify.toml:
netlify.toml