Skip to content

Send Auth.js magic links from Loops

Auth.js has a built-in Loops provider. Add two environment variables, and every magic link email comes from a template you design in Loops.

Auth.js providernext-auth/providers/loops
A
Sign in to AcmeAcme · to Sam
Check your email

Your sign-in link

Hi Sam, use the button below to sign in to Acme.

Sign in to Acme
Didn’t try to sign in? You can ignore this email.
AcmeQuestions? Just reply to this email.
More

A sign-in email you control

The subject, sender, and content all live in Loops.

Design it in Loops

Build the magic link email in the Loops editor and style it with the style panel instead of HTML.

Add a url data variable to a button, text, or image, and Auth.js fills in each user’s sign-in link.

Edit it in Loops

Change the subject, From address, and content in Loops. Your Auth.js config only holds the API key and transactional ID.

See every send

Transactional email logs show which sign-in emails went out, when, and to whom.

How it connects

The Loops provider ships with Auth.js. The docs cover each step.

Create the email

Publish a transactional email in Loops with a data variable named url.

Add two variables

Add your Loops API key and the email’s transactional ID as two environment variables.

Use the Loops provider

Import Loops from next-auth/providers/loops and add it to your providers, next to your database adapter.

Frequently asked questions

Which Auth.js emails does Loops send?

Magic link emails, which go out when a user tries to sign in with their email address. The Loops provider sends each one with the transactional email you set up in Loops.

Do I need a database adapter?

Yes. Auth.js needs a database adapter for magic link authentication, so configure one before you add the Loops provider.

What should the data variable be called?

url. Auth.js passes each user’s magic link as url, so the data variable in your Loops email must use that exact name. You can add it to a button, text, or image link.

Where do I find the transactional ID?

Open the email in Loops and click through to the Publish page, where the Transactional ID is listed. Your API key is under Settings, API.

Can I change the email without a code change?

Yes. The subject, From address, reply-to address, and content are all managed in Loops. When you edit the email, the published version keeps sending until you click Republish.

Is there a free plan?

Yes. The free plan includes unlimited contacts and up to 4,000 emails to your first 1,000 contacts in any rolling 30-day window, marketing and transactional combined. Upgrade to send to more subscribed contacts.