Star
Packages

@notifkit/provider-resend

The email transport. Sends through Resend and mounts a webhook route that feeds opens, clicks, bounces and complaints back into your delivery log and the suppression list.

npm install @notifkit/provider-resend

Commit an .npmrc without legacy-peer-deps=true. Otherwise the lockfile misses React peers and npm ci fails in Docker or CI.

import { NotifkitServer } from "notifkit";
import { ResendTransport } from "@notifkit/provider-resend";

const server = new NotifkitServer({
  services: ["all"],
  providers: [
    new ResendTransport({
      apiKey: process.env.RESEND_KEY!,
      from: "[email protected]",
      webhookSecret: process.env.RESEND_WEBHOOK_SECRET,
    }),
  ],
});

Options

OptionRequiredNotes
apiKeyyesYour Resend API key.
fromyesDefault sender. A template may override it (see below).
webhookSecretnoThe svix signing secret. Without it every webhook is rejected (see below).
loggernoA notifkit logger. Send failures are logged at warn.
limitsnoProvider rate limit. Defaults to { limit: 1000, windowSeconds: 10 }.

Which template keys it reads

Template keyLands as
subjectThe subject line. Defaults to "Notification" if absent.
text or bodyThe plain-text part.
html or htmlBodyThe HTML part. Falls back to the text wrapped in <p>.
fromOverrides the constructor's sender, for this template only.
replyToSent only when present.

Sending from more than one address

The constructor's from is a default. A template's own from wins, so one transport serves no-reply@ for receipts and marketing@ for campaigns:

await notifkit.syncTemplates({
  templates: [
    {
      id: "receipt",
      channel: "email",
      content: { from: "[email protected]", subject: "Your receipt", text: "…" },
    },
    {
      id: "spring-sale",
      channel: "email",
      topic: "promotions",
      content: {
        from: "Acme Offers <[email protected]>",
        replyTo: "[email protected]",
        subject: "{{headline}}",
        html: "<h1>{{headline}}</h1>",
      },
    },
  ],
});

Both accept the display-name form ("Acme <[email protected]>"). A value that isn't a non-empty string is ignored and the default is used.

Webhooks

The transport declares webhookPath = "/webhooks/resend", which the API mounts automatically. Point Resend at https://your-public-url/webhooks/resend.

Resend eventBecomes
email.openedopened
email.clickedclicked, with the URL kept on the log row
email.bouncedbounced: suppresses only when Resend calls it permanent
email.complainedcomplained, which suppresses
email.delivered, email.delivery_delayedignored
No secret means no webhooks at all

Without webhookSecret every webhook is rejected, so bounces and complaints never suppress the address.