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

```javascript theme={null}
import { StytchB2BClient } from '@stytch/vanilla-js/b2b';

const stytch = new StytchB2BClient('public-token-test-b8c84de4-7d58-4ffc-9341-432b56596862');

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

  console.log('Valid:', response.valid_password);
  console.log('Score:', response.score, '/4');
  if (response.breached_password) {
    console.log('Warning: Password has been breached!');
  }
};

checkStrength('testPassword123!');
```
