Skip to main content

Installation

npm install nexveil-auth

Example Usage

const NexveilAuth = require('nexveil-auth')
const auth = new NexveilAuth({
  // Required
  appName: 'MyApp',              // Your app name registered in Nexveil
  secret1: '64_char_hex...',     // First secret (from app metadata)
  secret2: '64_char_hex...',     // Second secret (from app metadata)
  secret3: '64_char_hex...',     // Third secret (from app metadata)
  
  // Optional
  apiUrl: 'https://...',         // API base URL (default: production)
  autoHWID: true,                // Auto-generate HWID (default: true)
  customHWID: null,              // Custom HWID override (default: null)
  strictSSL: true                // Enforce strict SSL (default: true)
});
auth.verify("license_key_here")
verify(key)
json
verify a license keyReturns: Promise<Object>
{
  success: true,           // Boolean - verification succeeded
  code: 'KEY_VALID',       // String - response code
  message: 'Success',      // String - human-readable message
  signature: 'abc123...',  // String - server signature
  isActivated: false,      // Boolean - true if key was just activated
  isValid: true,           // Boolean - key is valid (activated or valid)
  timestamp: '2024-...',   // String - verification timestamp
  data: {                  // Object - additional data
    key: {
      expiresAt: '2025-01-01T00:00:00Z',
      activatedAt: '2024-06-15T10:30:00Z',
      note: 'Premium tier'
    },
    app: {
      version: '1.2.3'
    }
  }
}
Response Codes:
  • KEY_VALID - License is valid (already activated)
  • KEY_ACTIVATED - License just activated (first use)
  • KEY_NOT_FOUND - License key doesn’t exist
  • KEY_EXPIRED - License has expired
  • KEY_REVOKED - License has been revoked
  • KEY_DISABLED - License disabled by administrator
  • HWID_MISMATCH - Hardware ID doesn’t match
  • USER_BANNED - User or device is banned
  • PROJECT_MISMATCH - Key doesn’t belong to this app
  • SIGNATURE_INVALID - Request signature invalid
  • TIMESTAMP_EXPIRED - Request timestamp out of range
  • SERVER_ERROR - Internal server error
Full documentation: https://github.com/venoxcc/nexveil-auth