AWS SES

Use AWS SES to send magic link emails

First, you’ll need to create your SMTP credentials for AWS Simple Email Service (SES):

  • On the old SES console, there’s an SMTP Settings link on the left side.

  • On the new SES console, the link is under Account dashboard on the left sidebar.

Create new SMTP credentials, and copy them. The final string will look like this:

smtp://username:password@email-smtp.us-east-1.amazonaws.com:587

There are three variables that you should replace in this string:

  • username and password, which are the SMTP credentials you created earlier.

  • us-east-1 replace it with the region that you’re sending emails from

Set this value into the .env file

AWS_SES_SMTP="smtp://username:password@email-smtp.us-east-1.amazonaws.com:587"

Open src/config/auth.ts and set:

EmailProvider({
    server: process.env.AWS_SES_SMTP || ""
    from: process.env.EMAIL_FROM || "",
    // maxAge: 24 * 60 * 60, // How long email links are valid for (default 24h)
}),

Last updated