bitsswap
v1.0.6
Published
Bitsswap license guard for frontend apps (React, Angular, JS)
Downloads
15
Maintainers
Readme
Bitsswap License Guard
Bitsswap is a lightweight, security-focused JavaScript utility designed to protect your frontend applications (React, Angular, Vue, or plain JS) using:
✅ License key verification
🌍 IP whitelisting
🚫 Brute-force protection with auto-blacklisting
🛒 Get Started To start using Bitsswap, you'll need to:
Purchase a license key: 👉 https://bitss.one/
Manage your license and whitelist IPs: 🔧 https://wap.bitss.one/
🚀 Key Features 🔑 License Key Verification – Checks backend for valid key.
🧠 Login Failure Tracking – Blocks repeated failed attempts.
🚫 Auto Blacklist – After 5 failed login attempts, client IP is blacklisted.
🌍 IP Whitelisting – Allows access only to approved IPs.
💣 Hard Block UI – Prevents app load for unauthorized users.
📡 IP Detection – Uses ipify to detect client IP.
📦 Installation
Install via NPM: npm install bitsswap
🧑💻 Usage Example import bitsswap from 'bitsswap';
// Initialize with your license key const licenseGuard = bitsswap('YOUR_LICENSE_KEY');
// Verify license before initializing your app licenseGuard.checkAccess()
// 🚀 Load your main app here
console.log('Access granted. App starting...');// Call this method when a login attempt fails await licenseGuard.reportLoginFailure(); 🔧 API Reference bitsswap(key: string): BitsswapInstance Initializes the Bitsswap module.
Parameters: key – Your Bitsswap license key
Returns: An instance with the following methods:
.checkAccess() Checks the validity of the license key via backend.
✅ Returns: true if valid ❌ Returns: false and shows a hard-block screen if invalid
.reportLoginFailure(): Promise Call this function on every failed login attempt.
Internally tracks failure count
After 5 failures, blacklists the client's IP
Automatically notifies backend
🌐 Expected Backend API Endpoints Bitsswap sends requests to the following endpoints. You must support them on your backend:
🔍 POST /wap/verify Headers:
http Copy Edit X-License-Key: YOUR_LICENSE_KEY Returns:
200 OK for valid license
403 Forbidden to block access
🚨 POST /report-failure Body:
json Copy Edit { "ip": "client-ip", "loginFailCount": 3 } 🚫 POST /blacklist-ip Body:
json Copy Edit { "ip": "client-ip" } 🔐 Security Best Practices Always host your backend over HTTPS
Keep license keys confidential and secure
Use the X-License-Key header for secure validation
Regularly monitor IP blacklist/whitelist in admin panel
👉 Manage IP Whitelist & Licenses
🛠 Development Notes Use npm run build for production builds
Exclude source code using .npmignore
Use npm pack to preview your package before publishing
📄 License MIT License © Bitss Technologies 🔗 bitss.fr — All rights reserved.
