Skip to content

Email Magic Link Authentication

Email magic link authentication allows you to log in and sign up users using an email address. Your users will receive a link in their inbox which will redirect them to your site (configured in the dashboard) to complete login.

Authenticate a user

example.ts
import { signer } from "./signer";
 
// send the email
await signer.authenticate({
  type: "email",
  emailMode: "magicLink",
  email: "user@mail.com",
});
 
// later once the user has clicked the link
const url = new URL(window.location.href);
const bundle = url.searchParams.get("bundle");
if (!bundle) {
  throw new Error("No bundle found in URL");
}
 
await signer.authenticate({
  type: "email",
  bundle,
});