|

Vercel

One-click install from the Vercel Marketplace. Connect your account, select your project, and AI bot telemetry starts flowing to your OA endpoint. Vercel's AI bots managed ruleset handles classification automatically.

Marketplace integration One-click install source_role: edge

How it works

flow
AI Bot ──GET──> Vercel Edge Network
                    │
                    ├── AI bots managed ruleset classifies request
                    │   (auto-maintained list, IP verification, DNS lookup, WBA)
                    │
                    ├── Log drain streams request data
                    └── OA integration processes + POST to telemetry endpoint

The integration uses Vercel's log drain API to stream request logs. When Vercel's AI bots managed ruleset identifies AI bot traffic, the integration constructs a content_retrieved event and forwards it to your OA telemetry endpoint.

Vercel maintains an auto-updated list of known AI bots with three verification methods: IP address verification, reverse DNS lookup, and cryptographic verification via Web Bot Authentication (RFC 9421). When new AI bots emerge, Vercel adds them automatically.


Setup

  1. Find OpenAttribution in the Vercel Marketplace
  2. Click Connect Account and authorise
  3. Select the Vercel project(s) to monitor
  4. Enter your OA org ID (or domain)
  5. Done - logs start flowing immediately
No code changes
The marketplace integration works entirely through Vercel's platform APIs. No middleware to add, no edge function to deploy, no code changes to your project.

Bot detection

Vercel provides two managed rulesets relevant to AI bot telemetry:

RulesetPurposeModes
AI bots managed rulesetIdentifies AI crawlers and bots (training, search, user-triggered)Log or Deny
Bot protection managed rulesetChallenges non-browser traffic, excludes verified botsLog or Challenge

The AI bots managed ruleset is the primary detection layer. Set it to Log mode to detect and report AI traffic without blocking it. The OA marketplace integration reads these logged events via the log drain.


Alternative: Edge Middleware

If you prefer to run detection in your own code, add OA telemetry reporting to your Vercel Edge Middleware. Note that Vercel's bot classification operates at the WAF layer and isn't directly exposed as headers to middleware, so this approach uses the @openattribution/vercel package for detection:

middleware.ts
import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';
import { isAiBot } from '@openattribution/vercel';

export function middleware(request: NextRequest) {
  const response = NextResponse.next();

  const ua = request.headers.get('user-agent') || '';

  if (isAiBot(ua)) {
    const event = {
      type: 'content_retrieved',
      timestamp: new Date().toISOString(),
      content_url: request.url,
      source_role: 'edge',
      oa_telemetry_id: request.headers.get('OA-Telemetry-ID') || undefined,
      data: { user_agent: ua },
    };

    // Fire and forget via waitUntil
    globalThis.waitUntil?.(
      fetch('https://telemetry.openattribution.dev/v1/events', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({
          events: [event],
          org_id: process.env.OA_ORG_ID,
        }),
      })
    );
  }

  return response;
}
Marketplace is the recommended path
The marketplace integration uses Vercel's platform-level bot detection, which is richer than what middleware can access. The middleware approach is a fallback for projects that need custom event construction or can't use the marketplace.

Existing precedent

Profound Agent Analytics is already live on the Vercel Marketplace doing the same thing - one-click AI bot analytics via log drain. The pattern is proven and the marketplace review process is well-documented.