Click Create New Key and ensure either Full Access or Custom Access with the Mail Send permission is selected. Copy the generated key
Create a new dynamic template in SendGrid and copy the Template ID
In the Authsignal Portal, select SendGrid as your email provider
Enter your SendGrid API key, Template ID, From email, and an optional From name
For detailed instructions on setting up a webhook for email delivery, see the webhooks documentation.
You can use Authsignal as an email provider for development, but it’s recommended to use an
alternative provider in production for more control over emails.
The following steps demonstrate how to implement adaptive MFA with email magic link - either at sign-in or as step-up authentication when the user performs a sensitive action in your app (e.g. making a payment).
You can choose a value for the action here which best describes what the user is doing in your app (e.g. signIn or createPayment).
Each action can have its own set of rules.
To learn more about using rules and handling different action states refer to our documentation on actions and rules.
If the action state is CHALLENGE_REQUIRED then you can present an email magic link challenge using the Web SDK.
Custom UI
Pre-built UI
Copy
Ask AI
// Set token from the track responseauthsignal.setToken("eyJhbGciOiJ...");// Send the user an email magic link// You can call this multiple times via a 'resend' buttonawait authsignal.emailML.challenge();// Check verification status// This will resolve when user clicks the magic linkconst verifyResponse = await authsignal.emailML.checkVerificationStatus();if (verifyResponse.data?.isVerified) { // Obtain a new token const token = verifyResponse.data.token;}
Copy
Ask AI
// Launch the pre-built UI with the URL from the track responseconst result = await authsignal.launch(url, { mode: "popup" });// Obtain a token to validate in the next stepif (result.token) { const token = result.token;}