Deno

Call the Resent HTTP API from Deno Deploy or Deno scripts.

Call the Resent HTTP API from Deno Deploy or Deno scripts.

Install

npm i resent.one

Set RESENT_API_KEY in your server environment. Keep the key off the client.

Send an email

const apiKey = Deno.env.get("RESENT_API_KEY");
const response = await fetch("https://resent.one/api/v1/email/send", {
method: "POST",
headers: {
Authorization: `Bearer ${apiKey}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
from: "Acme <noreply@yourdomain.com>",
to: ["you@example.com"],
subject: "Hello from Deno",
html: "<strong>It works!</strong>",
}),
});
console.log(await response.json());

Next steps