initiateEmailVerification()

This function is crucial for sending OTP verification emails, enhancing user security by delivering dynamic and time-sensitive authentication codes. Its versatility extends to diverse applications, ensuring a reliable and secure means of user identity confirmation.

Here's an example:

import { createBackendFunction, utils } from "@magicjs.dev/backend";

export default createBackendFunction(async function () {
    await utils.initiateEmailVerification("user@gmail.com", 1102); // recipient email, OTP
    return "OTP Sent!";
});

Click here to refer GitHub.

Last updated