How to resend OTP code to mail using MFA widget javascript

Hi Everyone,

I am trying the MFA widget javascript to customize the UI, but I could not able to find an option/method to trigger resend of OTP to mail

using the script tag
<script src="//"></script>

Need your help on how to trigger new OTP code to mail by triggering resend

1 Like

To trigger a resend of the OTP code using the Auth0 MFA Widget JavaScript library, you can use the auth0.mfa.resendOTP() method. This method will send a new OTP code to the user’s registered email address. Here is an example of how to use it:

<script src="//"></script>
  var mfaWidget = new Auth0MFAWidget({
    domain: 'YOUR_AUTH0_DOMAIN',
    clientId: 'YOUR_AUTH0_CLIENT_ID',
    // Other configuration options

  // Trigger resend OTP code
  function resendOTP() {
      .then(function() {
        // Resend successful
        console.log('OTP code resent');
      .catch(function(error) {
        // Handle resend error
        console.error('Error resending OTP code:', error);

You can call the resendOTP() method whenever you want to trigger a new OTP code to be sent to the user’s email address.