Configure the client
import { MaildenoClient } from "maildeno"
const client = new MaildenoClient({
// Required — obtain from Dashboard → API Keys → Create Key
apiKey: process.env.MAILDENO_API_KEY!,
// Optional — request timeout in ms, defaults to 30000
timeout: 10_000,
})
Client lifecycle
The MaildenoClient is stateless — it holds only configuration. There is no connection pool to manage. Instantiate it once at module level and reuse across requests:
// Module-level singleton — recommended
const maildeno = new MaildenoClient({ apiKey: process.env.MAILDENO_API_KEY! })
export async function sendWelcomeEmail(name: string, to: string) {
const html = await maildeno.renderHtml("template-id", {
merge_tags: { text: { name } },
})
// ... send html via your email provider
}
Node.js version requirements
| Node version | Notes |
|---|---|
18+ |
Native |
< 18 |
Install |
Other runtimes
| Runtime | Notes |
|---|---|
Bun |
Native |
Deno |
Native |
Cloudflare Workers |
Native |
Browser |
Native |