This release is 4 versions behind 0.4.0 — the latest version of @upyo/plunk. Jump to latest
Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
Works with
•JSR Score100%•This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers




Downloads1/wk
•Published2 months ago (0.3.1)
Plunk transport for Upyo email library
@upyo/plunk
Plunk transport for the Upyo email library.
Installation
npm add @upyo/core @upyo/plunk pnpm add @upyo/core @upyo/plunk yarn add @upyo/core @upyo/plunk deno add --jsr @upyo/core @upyo/plunk bun add @upyo/core @upyo/plunk
Usage
import { createMessage } from "@upyo/core"; import { PlunkTransport } from "@upyo/plunk"; import fs from "node:fs/promises"; 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." }, attachments: [ new File( [await fs.readFile("image.jpg"), "image.jpg", { type: "image/jpeg" }] ) ], }); const transport = new PlunkTransport({ apiKey: process.env.PLUNK_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(", ")); }
Configuration
See the Plunk docs for more information about configuration options.
Available Options
apiKey: Your Plunk API keybaseUrl: API base URL (default:https://api.useplunk.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 (default:{})
Self-hosted instances
This transport supports self-hosted Plunk instances. Set the baseUrl to your
domain followed by /api:
import { PlunkTransport } from "@upyo/plunk"; const transport = new PlunkTransport({ apiKey: "your-api-key", baseUrl: "https://mail.yourcompany.com/api", });
Built and signed on
GitHub Actions
Add Package
deno add jsr:@upyo/plunk
Import symbol
import * as plunk from "@upyo/plunk";
Import directly with a jsr specifier
import * as plunk from "jsr:@upyo/plunk";
Add Package
pnpm i jsr:@upyo/plunk
pnpm dlx jsr add @upyo/plunk
Import symbol
import * as plunk from "@upyo/plunk";
Add Package
yarn add jsr:@upyo/plunk
yarn dlx jsr add @upyo/plunk
Import symbol
import * as plunk from "@upyo/plunk";
Add Package
vlt install jsr:@upyo/plunk
Import symbol
import * as plunk from "@upyo/plunk";
Add Package
npx jsr add @upyo/plunk
Import symbol
import * as plunk from "@upyo/plunk";
Add Package
bunx jsr add @upyo/plunk
Import symbol
import * as plunk from "@upyo/plunk";