> ## Documentation Index
> Fetch the complete documentation index at: https://stytch.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Stytch Password Reset

> Implement password reset UI using the Stytch Next.js SDK

![Example of Password Reset component](https://mintcdn.com/stytch-34ca0595/chUftqYqk2C1W0Ql/images/api-reference/b2c/frontend-sdks/prebuilt-ui-password-reset.png?fit=max\&auto=format\&n=chUftqYqk2C1W0Ql\&q=85\&s=6b3806c91e9fc8dfcf5aecb5830a70c6)

The SDK comes with a pre-built UI component to reset passwords for our Passwords product. Render this component on the page at `resetPasswordRedirectURL` if using our `<StytchLogin>` prebuilt component, or the URL sent to the user by our [reset password start API](https://stytch.com/docs/api-reference/consumer/api/passwords/reset-options/password-reset-by-email-start.md).

## Props

**passwordResetToken** `string`

Password reset token. The component will read the token from the current page by default, you only need to pass this in if the token is not there. To retrieve the token manually, use the `client.parseAuthenticateUrl()` method. The token will be available in the `token` property in the returned object.

**config** `object`

The configuration object for the UI component. This component accepts the same `config` as StytchLogin so you can reuse the config, although most options will not have any effect.

**properties**

**sessionOptions** `object`

The options for session management. We create a session for users when they log in. You can access a user or session using the User or Session SDK methods.

**properties**

**sessionDurationMinutes** `number`

Set the session lifetime to be this many minutes from now; minimum of 5 and a maximum of 527040 minutes (366 days). Note that a successful authentication will continue to extend the session this many minutes.

**presentation**

The `presentation` field allows you to customize the look of the SDK. This component accepts the same `presentation` prop as `StytchLogin` so you can reuse it. For more information, see the [Theming documentation](https://stytch.com/docs/api-reference/consumer/frontend-sdks/react/prebuilt-ui/theming.md).

**callbacks** `object`

Optional callbacks that are triggered by various events in the SDK. See more details about the callbacks [here](https://stytch.com/docs/api-reference/consumer/frontend-sdks/react/prebuilt-ui/login/callbacks.md).

**onEvent** `(data) =\> void`

A callback function that responds to events sent from the SDK.

**events**

**PASSWORD\_RESET\_BY\_EMAIL** `(data) =\> void`

Fired when the user successfully reset their password.

```ts data theme={null}
{
  user_id: "user_id",
  session: { ... },
  user: { ... },
  user_device?: { ... }
}
```

**onError** `(data) =\> void`

A callback function that responds to errors in the SDK. It is useful for debugging during development and error handling in production.

**strings** `object`

Specify custom strings to be used in the prebuilt UI. Consult the message catalog (messages/en.po) for the list of available strings. Each value should be specified using ICU MessageFormat.

Strings that are not defined will use the default English value as a fallback.

See [Text Customization](https://stytch.com/docs/api-reference/consumer/frontend-sdks/react/prebuilt-ui/text-customization.md) for more information.

```jsx theme={null}
import { StytchPasswordReset, useStytch } from '@stytch/nextjs';

const config = {
  sessionOptions: {
    sessionDurationMinutes: 60,
  },
};

export const ResetPassword = () => {
  const stytch = useStytch();
  const parsed = stytch.parseAuthenticateUrl();

  if (!parsed?.token) {
    // Handle missing token
    return <>...</>;
  }

  return <StytchPasswordReset config={config} passwordResetToken={parsed.token} />;
};
```
