Consumer Authentication

/

Mobile SDKs

/

React Native SDK reference

/

Passwords

/

Reset by Email Start

Reset by email start

The resetByEmailStart method wraps the Reset By Email Start Password API endpoint. This endpoint initiates a password reset for the email address provided. This will trigger an email to be sent to the address, containing a magic link that will allow them to set a new password and authenticate.


Method parameters


email*string

Configurationobject

Additional configuration.

reset_password_redirect_urlstring
login_redirect_urlstring
reset_password_expiration_minutesint
reset_password_template_idstring

Response fields


request_idstring

status_codeint

user_idstring

email_idstring
import React, { useCallback } from 'react';
import { Text, TouchableOpacity, View } from 'react-native';
import { useStytch } from '@stytch/react-native';

export const Login = () => {
  const stytch = useStytch();

  const resetPasswordStart = useCallback(() => {
    stytch.passwords.resetByEmailStart({
      email: '${exampleEmail}',
    });
  }, [stytch]);

  return (
    <View>
      <TouchableOpacity onPress={resetPasswordStart}>
        <Text>Reset Password Start</Text>
      </TouchableOpacity>
    </View>
  );
};

RESPONSE

200
{
    "status_code": 200,
    "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
    "user_id": "user-test-16d9ba61-97a1-4ba4-9720-b03761dc50c6",
    "email_id": "email-test-81bf03a8-86e1-4d95-bd44-bb3495224953"
}