FabricFabricSDK
Plugins

Resend

Send transactional emails and handle delivery webhooks.

Authentication

TypeDefaultDetails
api_keyAPI key (re_...) sent as Authorization: Bearer

OAuth is not supported — Resend is API-key only.

Endpoints

PathRiskDescription
emails.sendwriteSend an email.
emails.getreadGet an email by id (status + tracking).
emails.batchwriteSend up to 100 emails in a single request.

emails.send

Send a single email.

Input:

FieldTypeRequiredDescription
fromstringSender address (must be a verified domain)
tostring | string[]Recipient address(es)
subjectstringEmail subject
htmlstringHTML body
textstringPlain text body
ccstring | string[]CC recipients
bccstring | string[]BCC recipients
reply_tostring | string[]Reply-to address(es)
tagsarrayArray of { name: string; value: string }

Output: { id: string }

emails.get

Get email status and tracking info.

Input:

FieldTypeRequiredDescription
idstringEmail ID

Output: ResendEmail

emails.batch

Send up to 100 emails in one request.

Input:

FieldTypeRequiredDescription
emailsarrayArray 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.

EventPathDescription
Deliveredemail.deliveredEmail was delivered to the recipient's server.
Bouncedemail.bouncedEmail bounced (hard or soft).
Complainedemail.complainedRecipient 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";
}