LaunchPad.js
Authentication

Magic Links

Magic Links is a feature that allows you to authenticate your users with a magic link.

Magic Links is a feature that allows you to authenticate your users with a magic link. It is a one-time password that is sent to the user's email address. The user clicks on the link and is redirected to your application.

Getting Started

You get the LaunchPadjs with the default Magic Links provider.

EmailProvider({
      server: {
        host: process.env.EMAIL_SERVER_HOST,
        port: parseInt(process.env.EMAIL_SERVER_PORT as string, 10),
        auth: {
            user: process.env.EMAIL_SERVER_USER,
            pass: process.env.EMAIL_SERVER_PASSWORD,
        },
      },
      from: process.env.EMAIL_FROM
    }),
    
  ]

For using it you need to setup an account on Resend and get the api key.

Update the api key in the .env file. Email server password is also the Resend api key. Rest of the details you can leave as it is. In EMAIL_FROM you need to put your email address from a domain you own and have verified on Resend.

RESEND_API_KEY=
EMAIL_SERVER_HOST=smtp.resend.com
EMAIL_SERVER_PORT=465
EMAIL_SERVER_USER=resend
EMAIL_SERVER_PASSWORD=
EMAIL_FROM=

That's it for the setup. You can now start the development server by running the following command.

npm run dev

On this page