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

providers/email

EmailProviderId

Re-exports EmailProviderId

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
paramsEmailProviderSendVerificationRequestParams
Returns

Awaitable<void>

server?

optional server: AllTransportOptions;

Used with SMTP-based email providers.

type

type: "email";

See ProviderType

Overrides

CommonProviderOptions.type


EmailProviderSendVerificationRequestParams

type EmailProviderSendVerificationRequestParams: {
  expires: Date;
  identifier: string;
  provider: EmailConfig;
  request: Request;
  theme: Theme;
  token: string;
  url: string;
};

Type declaration

expires

expires: Date;

identifier

identifier: string;

provider

provider: EmailConfig;

request

request: Request;

theme

theme: Theme;

token

token: string;

url

url: string;

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