---
title: "Save Resend email events to your Turso Database"
description: "Resend email webhook events (sent, delivered, bounced, opened, clicked, etc.) can be persisted to a Turso database through a small Hono/Node.js handler using @libsql/client."
url: "https://swe.quest/articles/save-resend-email-events-to-your-turso-database-e416b48a04ff4cae"
canonical: "https://turso.tech/blog/save-resend-email-events-to-your-turso-database"
source: "Turso"
published: "2024-07-23"
difficulty: "medium"
kind: "How-to"
reading_minutes: 7
tags: ["sqlite","communications","javascript","typescript"]
---

# Save Resend email events to your Turso Database

A post on [Turso](https://swe.quest/sources/turso.md), published 2024-07-23, 7 min read, How-to. Original: [https://turso.tech/blog/save-resend-email-events-to-your-turso-database](https://turso.tech/blog/save-resend-email-events-to-your-turso-database)

## Summary

Resend email webhook events (sent, delivered, bounced, opened, clicked, etc.) can be persisted to a Turso database through a small Hono/Node.js handler using @libsql/client. The walkthrough creates \`events\` and \`clicks\` tables. It parses the webhook payload, generates UUIDs, flattens recipient arrays to CSV, and inserts click details separately for \`email.clicked\` events. Local testing uses a Hookdeck CLI tunnel. Production advice covers verifying signatures with svix, queueing events for background processing, adding indexes, and deploying to a cloud host.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [SQLite](https://swe.quest/tags/sqlite.md) (Data & databases)
- [Communications](https://swe.quest/tags/communications.md) (Domains)
- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)
- [TypeScript](https://swe.quest/tags/typescript.md) (Languages)

## Prerequisites

- Node.js basics ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))
- Webhooks
- Basic SQL ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))

## Keywords

Turso, Resend, Hono, libSQL, Hookdeck, svix

## Related posts

- [Storing Vercel's AI SDK chat messages in a Turso database](https://swe.quest/articles/storing-vercel-s-ai-sdk-chat-messages-in-a-turso-database-14cd5acbb753b2cf.md): Turso · 2024-08-07 · Medium · 5 min read · SQLite, LLMs, React, TypeScript
  Vercel AI SDK's useChat hook doesn't persist conversations, so chat history can be stored in a Turso (libSQL) table and reloaded on page render.
- [Use SQLite triggers to send new user emails](https://swe.quest/articles/use-sqlite-triggers-to-send-new-user-emails-27dbd430dfe83f99.md): Turso · 2024-08-12 · Medium · 5 min read · SQLite, Serverless, Event-driven architecture, Communications, TypeScript
  An AFTER INSERT trigger on a users table copies each new row into a new\_users outbox table.
- [Write that blog… with Turso!](https://swe.quest/articles/write-that-blog-with-turso-eb57ed9c715594d8.md): Turso · 2024-10-08 · Medium · 4 min read · SQLite, Databases, Frontend
  WriteThatBlog!, an aggregator of engineering blog posts tagged by writing pattern, is a single static HTML page on GitHub Pages that queries a replicated Turso database directly from the browser over HTTP, with no backend functions or proxies.
- [Create a fast, performant admin UI with Retool and Turso](https://swe.quest/articles/create-a-fast-performant-admin-ui-with-retool-and-turso-5c186550c3794073.md): Turso · 2023-11-16 · Medium · 7 min read · SQLite, Product engineering, E-commerce
  A Retool admin dashboard for an e-commerce mug store can read and write data in a Turso (libSQL) database through Turso's HTTP API, configured as a Retool REST API resource.
- [Create a database branch with GitHub Actions](https://swe.quest/articles/create-a-database-branch-with-github-actions-d979dde1d3eb17f6.md): Turso · 2024-01-18 · Medium · 5 min read · CI/CD, SQLite, Databases
  A GitHub Actions workflow triggered on branch creation can call the Turso Platform API to seed a new database from an existing one, giving each Git branch its own isolated database.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
