senternet-site-email-resend

Configures Resend transactional email sending through Firebase Cloud Functions v2.

Updated May 8, 2026
One-click install
npx skills add https://github.com/MattSenter/senternet-site-skills --skill senternet-site-email-resend-mattsenter
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: senternet-site-email-resend
Source: https://github.com/MattSenter/senternet-site-skills/tree/main/.claude/skills/senternet-site-email-resend
Command: npx skills add https://github.com/MattSenter/senternet-site-skills --skill senternet-site-email-resend-mattsenter

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires firebase-functions, firebase-admin, typescript.

What problem does it solve? Adding transactional email to a static or Firebase-hosted site requires wiring up a third-party email API, storing the API key securely, granting the right IAM permissions, and scaffolding a Cloud Function — a multi-step process that is easy to get wrong. This Skill walks through the entire setup so the Resend API key never touches the repo and the function deploys correctly the first time. ## Core Features & Use Cases - Secret Management: Stores the Resend API key in Firebase Secret Manager and grants the compute service account the secretAccessor role, keeping credentials out of source control. - Two Trigger Variants: Scaffolds either a Firestore-triggered function (fires when a document is created, with optional welcome email via Resend template) or an HTTP callable function accepting to, subject, html, and text. - Next.js Track: For Next.js sites, uses a route handler with the key as a RUNTIME-only Secret Manager reference in apphosting.yaml instead of a functions directory. - Use Case: A marketing site has a signup form writing to a Firestore collection. Run this Skill to deploy a function that emails the admin on every new submission and optionally sends the submitter a welcome email. ## Quick Start Set up Resend email sending for my site with a Firestore trigger on the signups collection that notifies alerts@example.com.

Frequently Asked Questions about senternet-site-email-resend

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I send transactional email from Firebase Functions with Resend?▼

Store the Resend API key in Firebase Secret Manager with firebase functions:secrets:set, grant the compute service account the secretAccessor role, then deploy a Cloud Function that calls the Resend API using defineSecret to inject the key at runtime.

How do I trigger an email when a Firestore document is created?▼

Use the onDocumentCreated trigger from firebase-functions/v2/firestore with a document path pattern like signups/{signupId}. The function reads the new document's fields and sends a notification email through the Resend API.

Can I use Resend with a Next.js site on Firebase App Hosting?▼

Yes. Create a route handler in app/api that calls Resend with process.env.RESEND_API_KEY, and declare the key as a RUNTIME-only secret reference in apphosting.yaml. Never prefix it with NEXT_PUBLIC_ or give it BUILD availability.

Why does my Firebase Function get a 403 Forbidden from Secret Manager?▼

A 403 means the function's service account lacks permission to read the secret. Grant the project's default compute service account the roles/secretmanager.secretAccessor role on the project, then redeploy the function.

How do I prevent duplicate emails when a Cloud Function retries?▼

Pass an Idempotency-Key header to the Resend API built from the event ID, such as notification/{event.id}. Resend deduplicates requests with the same key, so retries do not send duplicate emails.