# Vercel

Vercel emits logs from your project's Functions, Edge Functions, Static Files, Rewrites, Builds, Firewall, and Redirects. Dstl8 receives them as a single webhook source and infers a stream per source type.

### Add a Vercel source

The webhook secret is generated by Vercel during drain creation, so you'll move between the two consoles. Open Vercel and Dstl8 in separate tabs.

#### 1. Start a drain in Vercel

In your Vercel dashboard:

1. Go to **Project Settings → Drains**.
2. Click **Add Drain**.
3. On **Choose data to drain**, select **Logs** and click **Next**.
4. On **Configure the drain**, set:
   * **Drain Name**: any name you'll recognize (e.g. `dstl8`).
   * **Projects**: choose **Specific Projects** and pick the Vercel project to drain.
   * **Sources**: leave all sources checked unless you have a reason to exclude one.
   * **Environment**: check **Production** (and **Preview** if you want preview deploys too).
5. Click **Next** to reach **Configure the destination**.

Leave this Vercel dialog open. You'll need the **Signature Verification Secret** value shown on this step in the next step.

#### 2. Open the Vercel source dialog in Dstl8

In Dstl8, from **Sources**, click **Add Source** and select **Vercel**.

#### 3. Configure the source

In the **Configure Vercel Source** dialog:

* **Name**: a unique name to identify this source (e.g. `vercel-prod` or the project name).
* **Signature Verification Secret**: copy the secret from Vercel's destination step and paste it here. Vercel uses this secret to sign webhook payloads, and Dstl8 uses it to verify them.

Click **Create**.

#### 4. Copy the webhook URL

Dstl8 displays the **Webhook URL** for your new source, e.g. `https://<org_id>.app.dstl8.ai/src-<id>`. Copy it. Keep this dialog open in case you need to reopen it.

#### 5. Finish the Vercel drain

Back in Vercel's **Configure the destination** step:

| Field                         | Value                                     |
| ----------------------------- | ----------------------------------------- |
| URL                           | The Webhook URL from Dstl8.               |
| Encoding                      | **JSON** or **NDJSON**. Either works.     |
| Signature Verification Secret | Already filled in by Vercel. Leave as is. |

Click **Test**. You should see *Success: Your endpoint sent a 2xx status*.

Click **Create Drain**.

### After creating

The source appears in Dstl8's Sources list as Pending with 0 streams. Once Vercel starts forwarding events, Dstl8 detects streams grouped by Vercel source type:

* `edge` — Edge Function invocations
* `lambda` — Function (serverless) invocations
* `static` — Static file requests
* `redirect` — Redirect responses

Other types (`rewrite`, `build`, `firewall`) appear as matching traffic arrives.

Within each type, streams are keyed by Vercel deployment ID, e.g. `dpl_AKjTAYM1iU1xpvvfTkxVCv3pJL3G`. A new deployment creates a new set of streams. The source transitions to Healthy once events are flowing.

### Assign streams to workspaces

Streams need to be assigned to a workspace to be accessible. Open the source's actions menu (gear icon) and select **Assign Streams**, then check the streams you want the Default workspace (or any other workspace) to receive and Save.

See [Assigning streams to workspaces](https://claude.ai/chat/f8733ef0-6c6d-491e-b91d-89419b661610#) for details.

### Tips

* Use a separate Vercel source per Vercel project rather than pointing multiple projects at the same endpoint, so streams don't collide.
* Each Vercel deployment creates a new set of streams (one per type, keyed by `dpl_...`). After a deploy, re-run **Assign Streams** to pick up the new ones in your workspace.
* If the **Test** in Vercel fails with a signature error, the secret in the Dstl8 dialog doesn't match the one Vercel generated. Reopen the Dstl8 source and update it, or regenerate the secret in Vercel and paste the new value into Dstl8.
* If logs aren't arriving after creation, check the drain status in Vercel's **Project Settings → Drains** for delivery errors.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.controltheory.com/controltheory-documentation/dstl8-docs/sources/vercel.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
