1. Verify your account and domain
Create a free account, verify your email address and create a project. Add a domain you own and publish the exact DNS records shown in its setup screen. The domain setup guide explains signing, the return path and common DNS problems.
2. Create a send-only API key
Create a Send emails key in your project and store it in your server environment as SENDPANDA_API_KEY. Never include the key in browser code or a NEXT_PUBLIC_ variable.
3. Install the official SDK
The JavaScript and TypeScript SDK supports Node.js 22 or newer, ESM and CommonJS.
npm install @sendpanda/sdk4. Send from your server
Replace the sender with an address on your verified domain and the recipient with your own email address. Test sends use your normal recipient quota. In Next.js, run this code in a server action or a Node.js route handler.
import { SendPanda, SendPandaError } from "@sendpanda/sdk";
const panda = new SendPanda(process.env.SENDPANDA_API_KEY!);
try {
const email = await panda.emails.send(
{
from: "Your app <hello@your-verified-domain.com>",
to: ["your-own-address@example.com"],
subject: "Hello from SendPanda",
html: "<h1>Your first email</h1><p>It works.</p>",
text: "Your first email. It works.",
},
{ idempotencyKey: "first-email-event-001" },
);
console.log(email.id, email.status);
} catch (error) {
if (error instanceof SendPandaError) {
console.error(error.status, error.message);
} else {
throw error;
}
}Use a unique idempotency key for each business event, and reuse that key when retrying the same event. A different message with the same key returns a conflict. A timeout can happen after acceptance, so avoid retrying with a new key.
5. Check delivery
A queued response means the API accepted the email. It does not mean the receiving server has delivered it. Open the message in the dashboard or fetch its status:
const email = await panda.emails.get("em_your_email_id");
console.log(email.status);Use signed webhooks for delivery and failure events in your application. Read the API integration reference for raw-body signature verification, retries and event deduplication.
Before sending more
- Preview your markup with the HTML email previewer, then test important layouts in actual email clients.
- Use the SPF checker on the MAIL FROM domain if DNS verification is taking longer than expected.
- Configure a DMARC monitoring policy and review the reports before enforcing rejection.