🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@sentinel-password/react

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sentinel-password/react

React hooks and components for @sentinel-password/core - password validation made simple

Source
npmnpm
Version
1.1.1
Version published
Weekly downloads
4.8K
-21.44%
Maintainers
1
Weekly downloads
 
Created
Source

@sentinel-password/react

npm version TypeScript License: MIT

React hook for password validation using @sentinel-password/core. Provides debounced validation with full TypeScript support.

Documentation | Interactive Playground | API Reference

Features

  • usePasswordValidator hook - Debounced password validation with configurable delay
  • TypeScript-First - Full type safety with strict mode
  • Lightweight - Minimal wrapper around @sentinel-password/core
  • React 18 & 19 - Supports both React 18 and 19

Installation

npm install @sentinel-password/react @sentinel-password/core
# or
pnpm add @sentinel-password/react @sentinel-password/core
# or
yarn add @sentinel-password/react @sentinel-password/core

Quick Start

import { usePasswordValidator } from '@sentinel-password/react'

function PasswordForm() {
  const { password, setPassword, result, isValidating } = usePasswordValidator({
    debounceMs: 300,
    minLength: 10,
    requireUppercase: true,
  })

  return (
    <div>
      <input
        type="password"
        value={password}
        onChange={(e) => setPassword(e.target.value)}
        placeholder="Enter password"
      />
      {isValidating && <span>Validating...</span>}
      {result && (
        <div>
          <p>Strength: {result.strength}</p>
          {result.feedback.suggestions.map((s, i) => (
            <p key={i}>{s}</p>
          ))}
        </div>
      )}
    </div>
  )
}

API

usePasswordValidator(options?)

Returns an object with:

PropertyTypeDescription
passwordstringCurrent password value
setPassword(password: string) => voidUpdate password and trigger validation
resultValidationResult | undefinedValidation result (undefined until first validation)
isValidatingbooleanWhether validation is in progress (during debounce)
validate() => voidManually trigger validation
reset() => voidReset password and validation state

Options

Extends all @sentinel-password/core options plus:

OptionTypeDefaultDescription
debounceMsnumber300Debounce delay in ms (0 to disable)
validateOnMountbooleanfalseValidate immediately on mount
validateOnChangebooleanfalseValidate on every change vs. after debounce

License

MIT © Aleksei Kankov

Keywords

password

FAQs

Package last updated on 22 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts