Implementation Guide

Quick Start

            More detailed instructions coming soon...
          

Basic Implementation

// First authenticate your user
const loginResponse = await fetch('/api/client/login', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    username: 'your_username',
    password: 'your_password',
    device_id: 'unique_device_id'
  })
});

const { access_token } = await loginResponse.json();

// Then validate the license
const validateResponse = await fetch('/api/client/tp/validateLicense', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    username: 'your_username',
    license: 'YOUR_LICENSE_KEY',
    hwid: 'HARDWARE_ID',
    apiKey: 'PRODUCT_API_KEY',
    accessToken: access_token
  })
});

const result = await validateResponse.json();
// result will contain:
// {
//   valid: true,
//   expiresAt: 1234567890, // or 'never' for lifetime
//   timeLeft: 86400 // seconds remaining, or 'unlimited'
}

Hardware ID Generation

// Generate HWID
const hwid = await auth.generateHWID();
console.log('Hardware ID:', hwid);

License Validation

  • Verify license key validity
  • Check expiration status
  • Validate hardware ID binding
  • Handle offline activation

User Management

  • Create new licenses
  • Manage user permissions
  • Handle license transfers
  • Monitor usage analytics

API Reference

POST /api/client/tp/validateLicense

Validates a license key against the server

Required fields:

  • username: string
  • license: string
  • hwid: string
  • apiKey: string
  • accessToken: string

POST /api/client/login

Authenticates a user and gets access token

Required fields:

  • username: string
  • password: string
  • device_id: string

Error Handling

400 Bad Request

Missing required fields

401 Unauthorized

Invalid access token or username mismatch

403 Forbidden

License not owned, expired, or HWID mismatch

404 Not Found

Invalid product API key or license not found