More detailed instructions coming soon...
// 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'
}// Generate HWID
const hwid = await auth.generateHWID();
console.log('Hardware ID:', hwid);Validates a license key against the server
Required fields:
Authenticates a user and gets access token
Required fields:
Missing required fields
Invalid access token or username mismatch
License not owned, expired, or HWID mismatch
Invalid product API key or license not found