New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

nap-auth-react

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nap-auth-react

React wrapper for the nap-auth behavioral authentication web component.

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

🔐 nap-auth-react

npm version license install size

A lightweight React wrapper for the nap-auth behavioral authentication Web Component. It enables seamless, passwordless login and registration based on how users interact — not what they type.

📦 Installation

npm install nap-auth-react nap-auth react react-dom

🚀 Usage

import NapAuth from 'nap-auth-react';

function App() {
  return (
    <NapAuth
      username="demo"
      mode="register" // or "login"
      onSuccess={(data) => console.log("✅ Auth success:", data)}
      onFail={(data) => console.log("❌ Auth failed:", data)}
      onProgress={(data) => console.log("⏳ Training progress:", data)}
    />
  );
}

⚙️ Props

PropTypeDescription
usernamestringUnique identifier for the user
modestringEither 'register' or 'login'
onSuccessfuncTriggered when authentication succeeds
onFailfuncTriggered when authentication fails
onProgressfuncTriggered during training mode to show progress state

📚 Events

Internally listens for:

  • auth-success: when behavior matches learned pattern
  • auth-fail: when confidence is too low
  • auth-progress: when registering a new user

These are forwarded as React callbacks (onSuccess, onFail, onProgress).

🧠 How It Works

  • Presents a drag-and-drop challenge inside a <canvas>
  • Tracks mouse velocity, hesitation, click pressure, and more
  • Feeds those patterns into a lightweight neural network
  • Uses confidence scoring to determine identity without passwords

🛠 Tech Stack

  • React + Web Components
  • Canvas interaction API
  • Custom JavaScript Neural Network
  • Vite for packaging
  • Optional TypeScript typings for autocomplete

🧪 Development

npm install
npm run dev

To build the library:

npm run build

📄 License

MIT © Pratik Acharya

Keywords

react

FAQs

Package last updated on 17 Apr 2025

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