Skip to content
Migrating from NextAuth.js v4? Read our migration guide.
API reference
email

providers/email

EmailConfig

Shared across all ProviderType

Extends

Properties

apiKey?

optional apiKey: string;

Used with HTTP-based email providers.

from?

optional from: string;

generateVerificationToken()?

optional generateVerificationToken: () => Awaitable<string>;
Returns

Awaitable<string>

id

id: string;

Uniquely identifies the provider in AuthConfig.providers It’s also part of the URL

Overrides

CommonProviderOptions.id

maxAge?

optional maxAge: number;

name

name: string;

The provider name used on the default sign-in page’s sign-in button. For example if it’s “Google”, the corresponding button will say: “Sign in with Google”

Overrides

CommonProviderOptions.name

normalizeIdentifier()?

optional normalizeIdentifier: (identifier) => string;
Parameters
ParameterType
identifierstring
Returns

string

options?

optional options: EmailUserConfig;

secret?

optional secret: string;

Used to hash the verification token.

sendVerificationRequest()

sendVerificationRequest: (params) => Awaitable<void>;
Parameters
ParameterType
paramsObject
params.expiresDate
params.identifierstring
params.providerEmailConfig
params.requestRequest
params.themeTheme
params.tokenstring
params.urlstring
Returns

Awaitable<void>

server?

optional server: AllTransportOptions;

Used with SMTP-based email providers.

type

type: "email";

See ProviderType

Overrides

CommonProviderOptions.type


EmailProviderType

type EmailProviderType: "email";

EmailUserConfig

type EmailUserConfig: Omit<Partial<EmailConfig>, "options" | "type">;

default()

default(config): NodemailerConfig

Parameters

ParameterType
configNodemailerUserConfig

Returns

NodemailerConfig

Deprecated

Import this provider from the providers/nodemailer submodule instead of providers/email.

To log in with nodemailer, change signIn("email") to signIn("nodemailer")

Auth.js © Balázs Orbán and Team - 2024