Send Vercel events to Tinybird

Vercel 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 events to Tinybird include:

  1. Tracking deployments, projects, integrations and domains status and errors.
  2. Creating custom analytical dashboards.
  3. Monitoring attacks.

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

Before you start

Before you connect Vercel webhooks 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 Settings > Webhooks.

  2. Select the Webhooks and Projects you want to send to Tinybird.

  3. In Tinybird, create a Data Source, called vercel in this example, with the following schema:

SCHEMA >
    `type` LowCardinality(String) `json:$.type`,
    `id` String `json:$.id`,
    `date` DateTime64(3) `json:$.created_at` DEFAULT now(),
    `region` LowCardinality(String) `json:$.region` DEFAULT '',
    `payload` JSON `json:$.payload` DEFAULT '{}'

ENGINE "MergeTree"
ENGINE_PARTITION_KEY "toYYYYMM(date)"
ENGINE_SORTING_KEY "type, date"

Using the JSON Data Type you can store the semi-structured data you receive from Vercel webhooks in a single column. You can later retrieve various events and their metadata as needed in your Pipes.

  1. In Tinybird, 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.

  2. Back in Vercel, paste the Events API URL in your Webhook Endpoint URL. Use the query parameter name to match the name of the Data Source you created in Tinybird. For example:

https://api.tinybird.co/v0/events?name=vercel&token=<your user token>

Replace the Tinybird API hostname or region with the API region that matches your Workspace.

  1. You're done. Any of the Vercel events you selected is automatically sent to Tinybird through the Events API.

You can check the status of the integration from the Log tab in the Tinybird vercel Data Source.

See also

Updated