Quickstart
Make one useful integration work end to end. This guide sends a test email using Resend's official Node.js SDK.
On this page
Before you start
You will need a server-side Node.js project and a Resend account. Create an API key and complete sender setup using the official Resend Node.js guide. Use a verified domain for your own sender address.
1. Install the official SDK
npm install resendInstall the provider's package directly. SDK SDK is the guide that helps you choose it; it is not another dependency in the request path.
2. Configure your environment
# Replace locally. Do not commit this value.
RESEND_API_KEY=your_resend_api_keyNext.js loads .env* values into process.env. Keep this secret unprefixed: NEXT_PUBLIC_ variables are bundled for the browser. See Next.js environment variables. For another runtime, use its documented environment loader.
3. Send a test email
Run this in server-side application code with the environment loaded. It adapts the official Resend sending example and checks both a missing key and a failed response.
import { Resend } from 'resend';
const apiKey = process.env.RESEND_API_KEY;
if (!apiKey) throw new Error('Missing RESEND_API_KEY');
const resend = new Resend(apiKey);
export async function sendTestEmail() {
const { data, error } = await resend.emails.send({
from: 'SDK SDK <onboarding@resend.dev>',
to: ['delivered@resend.dev'],
subject: 'Your first integration',
text: 'One small integration, working end to end.',
});
if (error) throw new Error(error.message);
if (!data) throw new Error('No email result returned');
return { id: data.id };
}
// Call from a trusted server workflow.
// await sendTestEmail();4. Understand the result
Keep the returned identifier for tracing. The Send Email reference documents request fields and the response. Handle provider errors separately from transport exceptions, and avoid logging the message body or recipient list by default.
- Confirm which sender and recipient are allowed in your account.
- Make one intentional call; avoid invoking email sending during component rendering.
- If the call times out, investigate before sending again. A timeout does not prove the email was never accepted.
Where to go next
SDK SDK is an independent discovery hub. Provider examples link to official documentation. App-owned examples are illustrative patterns you can adapt.