Skip to content

Latest commit

Β 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Authon

Authon JavaScript SDK

Official JavaScript/Node.js SDK for Authon β€” Software Licensing & Authentication Platform

Website Discord Status Node.js License


πŸš€ Quick Start

1. Requirements

  • Node.js 18+ (uses built-in fetch)
  • No external dependencies

Also works with: Electron, Bun, Deno

2. Get Your Credentials

  1. Create an account at authon.pro
  2. Go to Dashboard β†’ Apps β†’ Create Application
  3. Copy your App ID and API Key

3. Use

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();

πŸ“– API Reference

Initialization

const auth = new Authon(appId, apiKey, [apiUrl]);
await auth.init();  // Returns: boolean

Authentication

await 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: boolean

Variables

await auth.getVar('key')              // Returns: string | null
await auth.setVar('key', 'value')     // Returns: boolean
await auth.getUserVar('key')          // Returns: string | null

Files

await auth.listFiles()                // Returns: [{id, name, size, minLevel}]
await auth.downloadFile(fileId)       // Returns: Buffer | null

Stats & Logging

await auth.log('message')             // Returns: boolean
await auth.fetchOnline()              // Returns: {count, users}
await auth.fetchStats()               // Returns: {totalUsers, onlineUsers, totalKeys}

Utility

Authon.getHWID()                      // Returns: string (static method)
await auth.checkBlacklist(ip, hwid)   // Returns: {blacklisted, reason}
await auth.redeemReferral(code)       // Returns: {success, message, data}

Properties

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

⚠️ Error Handling

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);
}

πŸ—οΈ Project Structure

javascript-Loader/
β”œβ”€β”€ authon.js           # SDK source (single file, zero dependencies)
β”œβ”€β”€ example.js          # Full interactive example
β”œβ”€β”€ package.json        # NPM package metadata
└── README.md           # This file

πŸ”— Links

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

πŸ“„ License

MIT β€” Free for commercial and personal use.


Built with ❀️ by Authon
The #1 KeyAuth Alternative

About

Authon JavaScript SDK - Node.js/Electron authentication, licensing & file management

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages