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!";
});

The proper functioning of initiateEmailVerification() necessitates an active subscription with mern.ai.

Without a valid subscription, the functionality may not perform as intended. Ensure that you have the requisite subscription in place to enable seamless email verification initiation.

Click here to refer GitHub.

Last updated