Plugins
Resend
Send transactional emails and handle delivery webhooks.
Authentication
| Type | Default | Details |
|---|---|---|
api_key | ✅ | API key (re_...) sent as Authorization: Bearer |
OAuth is not supported — Resend is API-key only.
Endpoints
| Path | Risk | Description |
|---|---|---|
emails.send | write | Send an email. |
emails.get | read | Get an email by id (status + tracking). |
emails.batch | write | Send up to 100 emails in a single request. |
emails.send
Send a single email.
Input:
| Field | Type | Required | Description |
|---|---|---|---|
from | string | ✅ | Sender address (must be a verified domain) |
to | string | string[] | ✅ | Recipient address(es) |
subject | string | ✅ | Email subject |
html | string | HTML body | |
text | string | Plain text body | |
cc | string | string[] | CC recipients | |
bcc | string | string[] | BCC recipients | |
reply_to | string | string[] | Reply-to address(es) | |
tags | array | Array of { name: string; value: string } |
Output: { id: string }
emails.get
Get email status and tracking info.
Input:
| Field | Type | Required | Description |
|---|---|---|---|
id | string | ✅ | Email ID |
Output: ResendEmail
emails.batch
Send up to 100 emails in one request.
Input:
| Field | Type | Required | Description |
|---|---|---|---|
emails | array | ✅ | Array of email objects (same shape as emails.send input) |
Output: { data: Array<{ id: string }> }
Usage
import { createFabric } from "@fabricorg/integrations";
import { resend } from "@fabricorg/integrations/plugins";
const fabric = createFabric({
plugins: [resend({ apiKey: process.env.RESEND_API_KEY })],
});
// Send a single email
const { id } = await fabric.resend.api.emails.send({
from: "notifications@example.com",
to: "alice@example.com",
subject: "Welcome to Fabric",
html: "<h1>Welcome!</h1><p>Your account is ready.</p>",
});
// Send in batch
const { data } = await fabric.resend.api.emails.batch({
emails: [
{ from: "@example.com", to: "alice@example.com", subject: "Hi Alice", text: "Hello!" },
{ from: "@example.com", to: "bob@example.com", subject: "Hi Bob", text: "Hello!" },
],
});Webhooks
Resend (powered by Svix) delivers email lifecycle events. The plugin includes verifyResendSignature for signature verification.
| Event | Path | Description |
|---|---|---|
| Delivered | email.delivered | Email was delivered to the recipient's server. |
| Bounced | email.bounced | Email bounced (hard or soft). |
| Complained | email.complained | Recipient marked as spam. |
Signature verification
import { verifyResendSignature } from "@fabricorg/integrations/plugins";
const valid = verifyResendSignature({
rawBody: requestBody,
msgId: headers["svix-id"],
timestamp: headers["svix-timestamp"],
signatureHeader: headers["svix-signature"],
secret: process.env.RESEND_WEBHOOK_SECRET,
});Webhook payload
interface ResendEventEnvelope {
type: "email.sent" | "email.delivered" | "email.bounced" | "email.complained" | "email.opened" | "email.clicked" | "email.delivery_delayed";
created_at: string;
data: { email_id: string; from: string; to: string[]; subject?: string };
}Types
interface ResendEmail {
id: string;
from: string;
to: string | string[];
subject?: string;
created_at?: string;
last_event?: "sent" | "delivered" | "bounced" | "complained" | "opened" | "clicked";
}