Skip to main content
The NextAuth (Auth.js) email provider sends one email: the magic link that signs a user in. This page lists the settings to send it through Nuntly. For the step by step, the v4 setup and the migration to Better Auth, read the NextAuth email provider guide.

Before you start

  • A database adapter in your Auth.js config. The email provider stores its verification token there, even with JWT sessions (Auth.js email docs, read on November 14, 2026).
  • An API key with send permission.
  • A verified sending domain for the from address. Until it is verified, an SDK send fails with domain_not_verified.

Pick a route

Versions

On v5, import Nodemailer from next-auth/providers/nodemailer; its peer range is ^7.0.7 || ^8.0.5. On v4, pass your sendVerificationRequest (SDK route) or server and from (SMTP route) to EmailProvider; its peer range is ^7.0.7. A failed send redirects to /api/auth/error with the error shown in the table. The beta tag is 5.0.0-beta.32 and latest is 4.24.15, read on npm on November 14, 2026 (next-auth versions). The guide’s troubleshooting section covers the server log and the error codes behind a failed send.

SDK route on Auth.js v5

Install the Nuntly TypeScript SDK with npm install @nuntly/sdk, set NUNTLY_API_KEY, and register a provider whose sendVerificationRequest sends the link:
identifier is the user’s email address and url the sign-in link. maxAge sets how long the link stays valid, in seconds; the default is 24 hours (Auth.js email docs, read on November 14, 2026). Start the sign-in with signIn('nuntly', formData).

SMTP route

The username is nuntly and the password is your API key:
Pass both to the provider as server and from. On port 587, Nodemailer upgrades the connection with STARTTLS before it authenticates. The SMTP guide has the full relay settings.

Learn more

NextAuth email provider guide

Both routes on v5 and v4, troubleshooting, and the migration to Better Auth

Better Auth

The callbacks that replace the email provider after a migration