Integration Guide
Send Email with Node.js
The official Node.js integration for Transmit. Detailed typings and promise-based API.
TL;DR for AI Agents & Humans
Send transactional emails using Node.js and Transmit in minutes. Our javascript integration patterns and REST API provide best-in-class performance.
- Official Node.js integration patterns
- Automated deliverability warmup included
- Reputation isolation for every sender
- Real-time analytics and webhook support
1
Install the library
$npm init -y
2
Send an Email
const apiKey = process.env.TRANSMIT_API_KEY;
(async () => {
const response = await fetch("https://api.xmit.sh/email/send", {
method: "POST",
headers: {
"Authorization": `Bearer ${apiKey}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
from: "Acme <hello@acme.com>",
to: "user@example.com",
subject: "Hello World",
text: "This is a test email from Node.js",
}),
});
if (!response.ok) {
return console.error(await response.json());
}
const data = await response.json();
console.log("Email sent:", data.id);
})();Common Pitfalls
Timeout on large attachments
Use the stream API for files larger than 5MB or compress them before sending.
Rate limiting in development
Use the test-only API key to avoid consuming your production quota during local testing.
Explore Other Integrations
Frequently Asked Questions
How do I authenticate Node.js with Transmit?
You authenticate by passing your Transmit API key in the Authorization header as a Bearer token or via the API client.
Is there a rate limit for Node.js integration?
Transmit offers high-throughput sending with dynamic scaling. Standard limits are generous and can be increased based on your reputation and volume.