@workermailer/resend • v0.1.0
Resend library
Resend delivery with Worker-native ergonomics.
@workermailer/resend brings the Resend API into Cloudflare Workers with the same queue and envelope patterns as the SMTP package.
Highlights
Aligned with SMTP patterns.
- Fetch-based Resend delivery, Worker compatible.
- Same envelope and queue helpers as @workermailer/smtp.
- Sandbox bundle included for EmDash provider wiring.
terminal Install with Bun
bun add @workermailer/resendresend.ts Quick start
import { ResendMailer } from '@workermailer/resend'
const mailer = await ResendMailer.connect({
apiKey: env.RESEND_API_KEY,
from: 'Worker Mailer <mail@acme.com>'
})
await mailer.send({
from: 'Worker Mailer <mail@acme.com>',
to: 'alice@acme.com',
subject: 'Hello from Resend',
text: 'Sent via Resend from a Cloudflare Worker.',
html: '<h1>Hello from Resend</h1><p>Worker-native delivery.</p>'
})Queues
Batch Resend deliveries with queues.
Use Cloudflare Queues to process sends out of band without changing your Resend payloads.
queue.ts Queue handler
import { createQueueHandler } from '@workermailer/resend/queue'
export default {
async queue(batch) {
const handleQueue = createQueueHandler()
await handleQueue(batch)
}
}Need SMTP instead?
Use the SMTP library for direct socket delivery, lifecycle hooks, and DSN support.