Send Resend webhooks to Tinybird¶
With Resend you can send and receive emails programmatically. By integrating Resend with Tinybird, you can analyze your email data in real time.
Some common use cases for sending Resend webhooks to Tinybird include:
- Tracking email opens and clicks.
- Monitoring delivery rates and bounces.
- Analyzing user engagement patterns.
- Creating custom dashboards for email performance.
- Enriching other data sources with real-time email metrics.
Read on to learn how to send data from Resend to Tinybird.
Before you start¶
Before you connect Resend to Tinybird, ensure:
- You have a Resend account.
- You have a Tinybird Workspace.
Connect Resend to Tinybird¶
Open the Resend UI and go to the Webhooks page.
Select Add Webhook.
In Tinybird, create a Data Source, called
resend
. You can follow this schema:
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"
Using the JSON Data Type you can store the semi-structured data you receive from Resend in a single column. You can later retrieve various events and their metadata as needed in your Pipes.
The JSON
data type is in private beta. If you are interested in using this type, contact Tinybird at support@tinybird.co or in the Community Slack.
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.
Back in Resend, paste the Events API URL in your Webhook 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=resend&token=<your user token>
Replace the Tinybird API hostname or region with the API region that matches your Workspace.
Select the checkboxes for the Resend events you want to send to Tinybird, and select Add.
You're done. Sending emails to Resend will now push events to Tinybird via the Events API.