> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usequotable.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Vercel

> Stream Vercel request logs to Agent Analytics with a Log Drain, bound to one Vercel project and to production traffic by default.

A Vercel Log Drain sends your project's request logs to Quotable as they happen. Nothing runs in your request path, and every field is available.

## Requirements

* A Vercel plan that includes Drains, and permission to create one for your team.
* The Vercel project that serves the domain the source is created for.

**What it measures:** every field, including response time, cache status and country.

## Set up

**1. Create the source in Quotable**

In **Agent Analytics**, select **Connect source**, choose **Vercel Log Drain** and select **Generate credentials**. Keep the wizard open: you'll paste values in both directions.

**2. Create the drain in Vercel**

In your Vercel team settings, create a log drain:

* **Data**: logs.
* **Projects**: only the project that serves this domain.
* **Sources**: the request log sources (static files, functions, edge, external rewrites). Build logs aren't request traffic and are dropped as `not_http_traffic`.
* **Environment**: production. Preview traffic is dropped unless you opt in (below).
* **Delivery format**: JSON or NDJSON. Both are accepted.
* **Endpoint URL**: the endpoint URL from the wizard.
* **Custom header**: `Authorization` with the value `Bearer aa_live_…`.

**3. Map the Vercel project in Quotable**

Under **Vercel project mapping** in the wizard, fill in:

* **Vercel project id**: the `prj_…` ID of the project. Logs from any other Vercel project are then dropped as `project_mismatch`.
* **Drain verification key**: the key Vercel shows while you create the drain. Quotable returns it in the `x-vercel-verify` header, which is how Vercel confirms the endpoint is yours.
* **Include preview deployments**: leave off unless you want preview traffic counted.

Select **Save mapping**, then finish creating the drain in Vercel.

**4. Confirm delivery**

Select **Check now** in Quotable. Vercel delivers within seconds of a request.

> [!TIP]
>
> The project mapping is optional, but set it. It protects the source if a drain is ever widened to more projects, and it makes the setup hints in **Check now** precise.

## Preview deployments

By default, only production traffic is counted. A preview deployment is a different site with a different audience, and its crawls would distort your production numbers. Records from other environments are dropped as `environment_filtered`.

To count previews, turn on **Include preview deployments** in the project mapping and select **Save mapping**.

## Test the endpoint

The wizard shows a `curl` command with the `x-agent-analytics-test: 1` header. It proves the token and endpoint work and shows how a GPTBot request is classified, without storing anything. See [Test deliveries](https://docs.usequotable.com/agent-analytics/connectors/custom-http.md#test-deliveries).

## Rotate the token

1. Rotate the token in Quotable. The old token stops working immediately.
2. Update the `Authorization` header of the drain in Vercel.

## Disconnect

Delete the drain in Vercel, then disconnect the source in Quotable.

## Troubleshooting

| Hint or symptom | Cause | Fix |
| - | - | - |
| Vercel can't verify the endpoint | The verification key isn't saved in Quotable | Paste the key under **Drain verification key** and select **Save mapping**, then retry in Vercel. |
| "mostly requests for a host other than …" | The drain covers a project that serves another domain | Select only the right project in the drain, or connect that domain as its own source. |
| "came from a different Vercel project than the one mapped" | The drain includes other projects | Select only the mapped project, or correct the project id. |
| "preview-deployment traffic, which is ignored by default" | The drain sends preview traffic | Restrict the drain to production, or opt into previews. |
| "build or function output rather than request logs" | Build or log-output sources are selected | Keep only request log sources. |
| `401` | Wrong or rotated token | Update the drain's `Authorization` header. |

## Next steps

> [card] [Read the dashboard](https://docs.usequotable.com/agent-analytics/dashboard.md)
>
> What to look at once data arrives.

> [card] [Troubleshooting](https://docs.usequotable.com/agent-analytics/troubleshooting.md)
>
> Fix deliveries that fail or arrive empty.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.