nap-auth
v1.0.2
Published
A lightweight behavioral authentication web component using neural patterns.
Downloads
12
Maintainers
Readme
🧠 nap-auth
A lightweight behavioral authentication Web Component that uses neural interaction patterns — identify users based on how they interact, not just what they do.
📦 Installation
npm install nap-auth🚀 Usage
1. Import the Component
import 'nap-auth';2. Add to HTML
<nap-auth username="demo" mode="register"></nap-auth>3. Listen for Events
document.querySelector('nap-auth').addEventListener('auth-success', e => {
console.log('✅ Auth Success:', e.detail);
});
document.querySelector('nap-auth').addEventListener('auth-fail', e => {
console.log('❌ Auth Fail:', e.detail);
});
document.querySelector('nap-auth').addEventListener('auth-progress', e => {
console.log('⏳ Training Progress:', e.detail);
});🧠 Features
- ✔️ Built with Vanilla JS + Web Components API
- 🖱️ Tracks user behavior (mouse speed, hesitations, interaction rhythm)
- 🧬 Simple neural network built-in
- 🔐 No passwords, no biometrics — just how you behave
- 🎯 Emits standard events:
auth-success,auth-fail,auth-progress
⚙️ Attributes
| Attribute | Type | Description |
|----------|----------|--------------------------------------------|
| username | string | Unique ID for the user |
| mode | string | register to train, login to authenticate |
🧱 Project Structure
nap-auth/
├── src/
│ ├── nap-auth.js # <nap-auth> component
│ ├── neutral-auth.js
│ └── auth/ # Neural engine + behavior tracking
│ ├── behavior-tracker.js
│ ├── neural-network.js
│ ├── feature-extractor.js
│ ├── authentication.js
│ └── anti-spoofing.js
├── dist/
│ └── nap-auth.mjs # Compiled output (ES module)
├── vite.config.js # Vite build config
├── package.json
└── README.md📜 License
MIT © Pratik Acharya
🧪 Development
git clone https://github.com/yourusername/nap-auth
cd nap-auth
npm install
npm run buildFor local preview testing:
npm run preview📣 Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you’d like to change.
📌 Related Tags
web-component neural-auth passwordless behavioral-auth biometrics custom-elements
Made with ❤️ by @pratikacharya1234
