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.
Authsignal supports sending with an SMTP server of your choosing.
In the Authsignal Portal, select SMTP as your email provider.
Enter your SMTP Server Address, Port, Username, Password, From Address, and an optional From name
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.
You can forward custom data points to your email provider as additional template variables.
This is useful for personalizing emails with data specific to your application, such as a user’s account ID or a transaction amount.To configure this, navigate to your email magic link settings in the Authsignal Portal and select which custom data points to include under Custom template variables.Custom data points are prefixed by model type:
User data points are prefixed with user_ (e.g. user_accountId)
Action data points are prefixed with action_ (e.g. action_transactionAmount)
Custom data points must be registered in the Authsignal Portal before they can be selected.
Only registered data points with values set on the user or action will be included.
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
// 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;}
// 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;}