Official JavaScript/Node.js SDK for Authon — Software Licensing & Authentication Platform
- Node.js 18+ (uses built-in
fetch) - No external dependencies
Also works with: Electron, Bun, Deno
- Create an account at authon.pro
- Go to Dashboard → Apps → Create Application
- Copy your App ID and API Key
const { Authon } = require('./authon');
const auth = new Authon('your-app-id', 'your-api-key');
async function main() {
// Connect
await auth.init();
console.log(`Connected: ${auth.appName} v${auth.appVersion}`);
// Login
const result = await auth.login('username', 'password');
if (result.success) {
console.log(`Welcome ${auth.username}! Level: ${auth.level}`);
console.log(`Subscription: ${auth.subscription}`);
console.log(`Expires: ${auth.expiresAt}`);
} else {
console.log(`Error: ${result.message}`);
}
// Download files
const files = await auth.listFiles();
if (files.length > 0) {
const buffer = await auth.downloadFile(files[0].id);
require('fs').writeFileSync(files[0].name, buffer);
}
// Logout
await auth.logout();
}
main();const auth = new Authon(appId, apiKey, [apiUrl]);
await auth.init(); // Returns: booleanawait auth.login(username, password, [hwid]) // Returns: {success, message, data}
await auth.license(key, [hwid]) // Returns: {success, message, data}
await auth.register(username, password, key) // Returns: {success, message}
await auth.check() // Returns: boolean
await auth.logout() // Returns: booleanawait auth.getVar('key') // Returns: string | null
await auth.setVar('key', 'value') // Returns: boolean
await auth.getUserVar('key') // Returns: string | nullawait auth.listFiles() // Returns: [{id, name, size, minLevel}]
await auth.downloadFile(fileId) // Returns: Buffer | nullawait auth.log('message') // Returns: boolean
await auth.fetchOnline() // Returns: {count, users}
await auth.fetchStats() // Returns: {totalUsers, onlineUsers, totalKeys}Authon.getHWID() // Returns: string (static method)
await auth.checkBlacklist(ip, hwid) // Returns: {blacklisted, reason}
await auth.redeemReferral(code) // Returns: {success, message, data}| Property | Type | Description |
|---|---|---|
sessionToken |
string |
Active session token |
username |
string |
Authenticated username |
level |
number |
User access level |
subscription |
string |
Subscription name |
expiresAt |
string |
Expiry date |
appName |
string |
Application name |
appVersion |
string |
Application version |
isAuthenticated |
boolean |
Has active session |
const result = await auth.login('user', 'wrong');
if (!result.success) {
// Possible messages:
// - "Invalid credentials"
// - "Account banned"
// - "Hardware ID mismatch"
// - "Subscription expired"
// - "Account is frozen"
// - "VPN/Proxy connections are not allowed"
// - "Application is paused"
console.error(result.message);
}javascript-Loader/
├── authon.js # SDK source (single file, zero dependencies)
├── example.js # Full interactive example
├── package.json # NPM package metadata
└── README.md # This file
| Resource | URL |
|---|---|
| 🌐 Website | https://authon.pro |
| 📖 Documentation | https://authon.pro/docs |
| 💬 Discord | https://discord.gg/MTY79JDFm6 |
| 📊 Status | https://authon.pro/status |
| 🔗 API Health | https://api.authon.pro/health |
| 🐙 GitHub | https://github.com/authonpro |
MIT — Free for commercial and personal use.
Built with ❤️ by Authon
The #1 KeyAuth Alternative
