Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
latest
dahlia/upyoWorks with
•JSR Score100%•This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers




Downloads1/wk
•Published3 weeks ago (0.4.0)
Resend transport for Upyo email library
@upyo/resend
Resend transport for the Upyo email library.
Features
- Single and batch email sending via Resend's HTTP API
- Automatic idempotency for reliable delivery
- Smart batch optimization: uses batch API when possible
- Cross-runtime compatibility (Node.js, Deno, Bun, edge functions)
- Rich content support: HTML emails, attachments, custom headers
- Retry logic with exponential backoff
- Type-safe configuration with sensible defaults
- Comprehensive error handling
Installation
npm add @upyo/core @upyo/resend pnpm add @upyo/core @upyo/resend yarn add @upyo/core @upyo/resend deno add --jsr @upyo/core @upyo/resend bun add @upyo/core @upyo/resend
Usage
import { createMessage } from "@upyo/core"; import { ResendTransport } from "@upyo/resend"; import process from "node:process"; const message = createMessage({ from: "sender@example.com", to: "recipient@example.net", subject: "Hello from Upyo!", content: { text: "This is a test email." }, }); const transport = new ResendTransport({ apiKey: process.env.RESEND_API_KEY!, }); const receipt = await transport.send(message); if (receipt.successful) { console.log("Message sent with ID:", receipt.messageId); } else { console.error("Send failed:", receipt.errorMessages.join(", ")); }
Sending Multiple Emails
const messages = [message1, message2, message3]; for await (const receipt of transport.sendMany(messages)) { if (receipt.successful) { console.log(`Email sent with ID: ${receipt.messageId}`); } else { console.error(`Email failed: ${receipt.errorMessages.join(", ")}`); } }
Configuration
See the Resend docs for more information about configuration options.
Available Options
apiKey: Your Resend API keybaseUrl: Resend API base URL (default:https://api.resend.com)timeout: Request timeout in milliseconds (default:30000)retries: Number of retry attempts (default:3)validateSsl: Whether to validate SSL certificates (default:true)headers: Additional HTTP headers
Built and signed on
GitHub Actions
Add Package
deno add jsr:@upyo/resend
Import symbol
import * as resend from "@upyo/resend";
Import directly with a jsr specifier
import * as resend from "jsr:@upyo/resend";
Add Package
pnpm i jsr:@upyo/resend
pnpm dlx jsr add @upyo/resend
Import symbol
import * as resend from "@upyo/resend";
Add Package
yarn add jsr:@upyo/resend
yarn dlx jsr add @upyo/resend
Import symbol
import * as resend from "@upyo/resend";
Add Package
vlt install jsr:@upyo/resend
Import symbol
import * as resend from "@upyo/resend";
Add Package
npx jsr add @upyo/resend
Import symbol
import * as resend from "@upyo/resend";
Add Package
bunx jsr add @upyo/resend
Import symbol
import * as resend from "@upyo/resend";