> ## 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.

# Password Strength Check

> Check password strength using the Stytch React SDK

`passwords.strengthCheck` wraps the [Strength Check](https://stytch.com/docs/api-reference/b2b/api/passwords/strength-check.md) Password API endpoint.

This endpoint allows you to check whether or not the Member's (Represents an individual end user's account within a given Organization, uniquely identified within that Organization by their email address.) provided password is valid based on the configuration set in your [Stytch Dashboard](https://stytch.com/dashboard/password-strength-config), and to provide feedback to the Member (Represents an individual end user's account within a given Organization, uniquely identified within that Organization by their email address.) on how to increase the strength of their password.

## Parameters

**password** `string` *required*

The password to authenticate, reset, or set for the first time. Any UTF8 character is allowed, e.g. spaces, emojis, non-English characters, etc.

**email\_address** `string`

The email associated with the password. Provide this for a more accurate strength check.

### Response fields

**valid\_password** `boolean`

Returns true if the password passes our password validation. We offer two validation options, [zxcvbn](https://stytch.com/docs/multi-tenant-auth/authentication/passwords/strength-policy.md#zxcvbn) is the default option which offers a high level of sophistication. We also offer [LUDS](https://stytch.com/docs/multi-tenant-auth/authentication/passwords/strength-policy.md#luds)  which is less sophisticated but easier to understand. If an email address is included in the call we also require that the password hasn't been compromised using built-in breach detection powered by [HaveIBeenPwned](https://haveibeenpwned.com/).

**score** `number`

The score of the password determined by [zxcvbn](https://github.com/dropbox/zxcvbn). Values will be between 1 and 4, a 3 or greater is required to pass validation.

**strength\_policy** `string`

The strength policy type enforced, either `zxcvbn` or `luds`.

**breach\_detection\_on\_create** `boolean`

Will return true if breach detection will be evaluated. By default this option is enabled. This option can be disabled in the [dashboard](https://stytch.com/dashboard/password-strength-config#breach-detection). If this value is false then `breached_password` will always be false as well.

**breached\_password** `boolean`

Returns true if the password has been breached. Powered by [HaveIBeenPwned](https://haveibeenpwned.com/).

**zxcvbn\_feedback** `object`

The feedback object contains relevant information to relay to users that failed to create a strong enough password.

**properties**

**warning** `string`

The warning message to display to the user.

**suggestions** `array`

The suggestions to display to the user.

**luds\_feedback** `object`

The feedback object contains relevant information to relay to users that failed to create a strong enough password.

**properties**

**has\_lower\_case** `boolean`

Returns true if the password has a lowercase letter.

**has\_upper\_case** `boolean`

Returns true if the password has an uppercase letter.

**has\_digit** `boolean`

Returns true if the password has a digit.

**has\_symbol** `boolean`

Returns true if the password has a symbol.

**missing\_complexity** `number`

Returns the number of complexity requirements that the password is missing.

**missing\_characters** `number`

Returns the number of characters that the password is missing.

```jsx theme={null}
import { useState } from 'react';
import { useStytchB2BClient } from '@stytch/react/b2b';

export const PasswordStrengthCheck = () => {
  const stytch = useStytchB2BClient();
  const [password, setPassword] = useState('');
  const [strength, setStrength] = useState(null);

  const checkStrength = async () => {
    const response = await stytch.passwords.strengthCheck({
      password: password,
      email_address: 'user@example.com',
    });
    setStrength(response);
  };

  return (
    <div>
      <input
        type="password"
        value={password}
        onChange={(e) => {
          setPassword(e.target.value);
          checkStrength();
        }}
        placeholder="Password"
      />
      {strength && (
        <div>
          <p>Valid: {strength.valid_password ? 'Yes' : 'No'}</p>
          <p>Score: {strength.score}/4</p>
          {strength.breached_password && <p>Warning: Password has been breached!</p>}
        </div>
      )}
    </div>
  );
};
```
