# Capture AI referral visits server-side with edge middleware

Canonical: https://devtune.ai/changelog/edge-middleware-ai-referrals-vercel-oidc

Published: 2026-11-15T00:00:00.000Z


`@devtune/ai-traffic` `0.13.0` captures AI-referred visits server-side alongside AI crawlers and answer fetchers, reading AI referrer hosts and campaign tags directly from your middleware without adding a browser script.

When your app sits behind a CDN such as Cloudflare, CloudFront or Fastly, DevTune checks the host daily to see whether pages pass through to your origin or are served from cache. Days on uncached CDN hosts count as measured; cached or uncertain hosts show as observed counts unless the browser snippet also covers them. Your agents can inspect per-host referral coverage over `GET /api/v2/projects/{projectId}/traffic/referral-hosts` and `devtune_get_traffic_referral_hosts`.

For Vercel deployments running `@devtune/ai-traffic` `0.11.0` or later, project admins on plans with AI Traffic Events can also link a Vercel team and project ID in AI Traffic settings to send middleware traffic with Vercel's deployment OIDC token and a project ID, with no ingest key to manage and an opt-in switch for preview deployments. Read the [edge middleware AI referral visits](https://docs.devtune.ai/ai-traffic/edge-middleware#ai-referral-visits) and [Vercel OIDC docs](https://docs.devtune.ai/ai-traffic/edge-middleware#vercel-oidc-without-an-ingest-key).
