---
id: guides-send-vercel-webhooks-to-tinybird
title: Send Vercel log drains to Tinybird
meta:
    description: Learn how to send Vercel events to Tinybird using webhooks and the Events API.
---

# Send Vercel log drains to Tinybird

[Vercel](https://vercel.com) is a platform for building and deploying web applications. By integrating Vercel with Tinybird, you can analyze your Vercel events in real time and enrich it with other data sources.

Some common use cases for sending Vercel Log Drains to Tinybird include:

1. Analyze logs from your applications.
2. Monitor logs from your applications.
3. Create custom analytical dashboards.
4. Build an alert system based on logging patterns.

Read on to learn how to send logs from Vercel to Tinybird.

## Before you start

Before you connect Vercel Log Drains to Tinybird, ensure:

* You have a Vercel account.
* You have a Tinybird workspace.

## Connect Vercel to Tinybird

1. Choose your team scope on the dashboard, and go to **Team Settings** > **Log Drains**.
   
2. Select the **Projects** to send logs to Tinybird.

3. Select **Sources** you want to send logs to Tinybird.

4. Select **NDJSON** as Delivery Format.

5. Select **Environments** and **Sampling Rate**.

6. In your Tinybird project, create a data source called `vercel_logs`. You can follow this [schema](https://github.com/tinybirdco/tinynest/blob/main/tinybird/datasources/vercel_logs.datasource):

```tb {% title = 'Data Source schema for Vercel webhooks %}
SCHEMA >
  `event_time` DateTime `json:$.tinybirdIngestTime` DEFAULT now(),
  `event_type` String `json:$.type` DEFAULT 'unknown',
  `event` JSON `json:$` DEFAULT '{}'

ENGINE "MergeTree"
ENGINE_PARTITION_KEY "toYYYYMM(event_time)"
ENGINE_SORTING_KEY "event_time"
```

The proxy column is a JSON string. Use the [JSONExtract](/sql-reference/functions/json-functions) functions to extract the data you need in your pipes.

7. From Tinybird Cloud, copy a token with privileges to append to the data source you created. You can use the admin token or create one with the required scope.

8. Back in Vercel, paste the Events API URL in your Log Drains Endpoint. Use the query parameter `name` to match the name of the data source you created in Tinybird.

Log Drains webhook needs to be verified by Vercel. You can do this by adding the `x-vercel-verify` parameter to the request.

```
{% user("apiHost") %}/v0/events?name=vercel_logs&x-vercel-verify=<your-x-vercel-verify-token>
```

{% snippet title="api-region-reminder" /%}

9. Select **Custom Headers**, add `Authorization` with the value `Bearer <your-tinybird-token>` and select **Add**.

10. Select **Verify** and optionally use **Test Log Drain** from Vercel to check data gets to the `vercel_logs` data source in Tinybird.

11. You're done. Any of the Vercel Log Drains you selected is automatically sent to Tinybird through the [Events API](../events-api).

Check the status of the from the **Log** tab in the Tinybird `vercel_logs` data source. 

## Vercel Logs Explorer Template

Use the [Vercel Logs Explorer Template](https://www.tinybird.co/templates/vercel-log-drains) to bootstrap a multi-tenant, user-facing logs explorer for your Vercel account. You can fork it and make it your own.
    
## See also

* [Events API](../events-api)
* [Vercel Log Drains](https://vercel.com/docs/log-drains/log-drains-reference)
