Documentation Index
Fetch the complete documentation index at: https://resend.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
To get the most out of this guide, you’ll need to:
1. Install
Install the NextAuth package.
Then, install the Nodemailer package.
Add your Resend SMTP crendentials in your application’s .env file:
EMAIL_SERVER_USER=resend
EMAIL_SERVER_PASSWORD=YOUR_API_KEY
EMAIL_SERVER_HOST=smtp.resend.com
EMAIL_SERVER_PORT=465
EMAIL_FROM=onboarding@resend.dev
Finally, in your […nextauth].js file (typically located in pages/api/auth), configure the Email provider with your SMTP settings:
import NextAuth from 'next-auth';
import EmailProvider from 'next-auth/providers/email';
import nodemailer from 'nodemailer';
export default NextAuth({
providers: [
EmailProvider({
server: {
host: process.env.EMAIL_SERVER_HOST,
port: process.env.EMAIL_SERVER_PORT,
auth: {
user: process.env.EMAIL_SERVER_USER,
pass: process.env.EMAIL_SERVER_PASSWORD,
},
},
from: process.env.EMAIL_FROM,
}),
// ... other providers as needed
],
// ... any other NextAuth.js configs
});