licenseInfo
Category: Application Control
Namespace: web.app.licenseInfo
Description
Get comprehensive license information including registration status, user name, package type, and expiration date. This provides all license-related details in a single call.
Syntax
const licenseInfo = await web.app.licenseInfo();
Parameters
None
Returns
Promise<Object> - License information object:
{
isLicensed: boolean,
registrationName: string,
packageName: string,
expirationDate: string
}
Example
Simple example
const info = await web.app.licenseInfo();
console.log('License Info:', info);
Practical example
const info = await web.app.licenseInfo();
if (info.isLicensed) {
alert(`Licensed to: ${info.registrationName}\nPackage: ${info.packageName}`);
} else {
alert('Trial version - Please purchase a license');
}
Advanced example
async function showLicenseDetails() {
const info = await web.app.licenseInfo();
const details = document.getElementById('license-details');
if (info.isLicensed) {
details.innerHTML = `
<h3>License Information</h3>
<p><strong>Status:</strong> Licensed</p>
<p><strong>Registered to:</strong> ${info.registrationName}</p>
<p><strong>Package:</strong> ${info.packageName}</p>
<p><strong>Expires:</strong> ${info.expirationDate || 'Never'}</p>
`;
} else {
details.innerHTML = `
<h3>Trial Version</h3>
<p>This is a trial version. Purchase a license to unlock all features.</p>
<button onclick="purchaseLicense()">Buy Now</button>
`;
}
}
Use Cases
- Display license information in About dialog
- Show registration details in settings
- Verify license status at startup
- Display package type and features
- Check expiration date for renewals
- Provide support information
- Track license for analytics
- Show personalized welcome message
Error Handling
This method does not throw errors. Returns an object with default values if unlicensed.
Performance Tips
- Call once at startup and cache the result
- Use for comprehensive license display
- Combine with UI to show license status
- Store in application state for quick access
Related Methods
web.app.licensed()- Quick license check (boolean)web.app.registrationName()- Get registration name onlyweb.app.packageName()- Get package name onlyweb.app.trialInfo()- Get trial-specific informationweb.app.resetRegistration()- Remove license data
Notes
- Returns all license information in one call
- More efficient than calling individual methods
- Useful for About dialogs and settings screens
- Empty strings returned for unlicensed fields