@waysnx/ui-security
v0.1.9
Published
Enterprise-grade security components from WaysNX - authentication, authorization, MFA, secure inputs, and session management
Maintainers
Readme
@waysnx/ui-security
🤖 AI agents & LLMs: See LLM.md (shipped with this package) for a structured integration guide — pre-built auth/MFA/session/authorization components and providers.
Enterprise-grade security components from WaysNX — authentication, authorization, MFA, secure inputs, and session management.
Installation
npm install @waysnx/ui-securityQuick Start
import { PasswordInput, LoginForm, LoginCard, OTPInput } from '@waysnx/ui-security';
import '@waysnx/ui-security/dist/index.css';Components
Password Management
PasswordInput— Secure input with visibility toggle and strength indicatorPasswordStrengthMeter— Visual password strength barPasswordRequirements— Live checklist of policy compliancePasswordGenerator— Generate random passwords with configurable optionsChangePasswordForm— Current + new + confirm password formForgotPasswordForm— Email input for password reset
Authentication
LoginForm— Complete login form (email, password, remember me)LoginCard— Styled card wrapper for auth forms
OTP & Verification
OTPInput— Multi-digit input with auto-advanceOTPVerificationCard— OTP verification flow cardOTPResendButton— Resend button with countdown timerEmailVerificationCard— Email verification flowPhoneVerificationCard— Phone verification flowDeviceVerificationDialog— Device trust verificationVerificationStatus— Verification state display
Providers
AuthenticationProvider— Auth context for login/logout/user stateAuthorizationProvider— Permission and role-based accessMFAProvider— Multi-factor authentication stateSessionProvider— Session management and timeout
Hooks
useAuth()— Access auth state and methodsuseOTP()— OTP generation and verificationusePasswordValidation()— Validate password against policyuseBiometricAuth()— Biometric authenticationuseIdleDetection()— Auto-logout on inactivityuseSecureStorage()— Encrypted localStorage
Utilities
hashPassword,verifyPassword— Password hashinggenerateToken,verifyToken— Token managementhasPermission,hasRole— Permission checksgenerateTOTPSecret,verifyTOTP— MFA utilitiesgetDeviceFingerprint— Device identificationcreateSession,isSessionValid— Session management
Theming
Uses shared --wx-* CSS tokens from the WaysNX UI Kit ecosystem. All components respond to theme overrides.
Dependencies
@waysnx/ui-core— Input, Button, Checkbox components@waysnx/ui-layout— Card, Stack layout@waysnx/ui-feedback— Badge, Modal, Alert@waysnx/ui-i18n— Internationalization support
License
Apache-2.0
