Package Exports
- @licensehub/license-client
- @licensehub/license-client/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@licensehub/license-client) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
License Client
Protect and monetize your proprietary TypeScript software with our robust license management solution.
Take Control of Your Software Distribution
The License Server Client empowers you to:
- Sell licenses for your TypeScript applications
- Control usage across devices and environments
- Limit activations to prevent unauthorized sharing
- Track usage with detailed analytics
- Enforce expiration for subscription-based models
Installation
As this is proprietary software, you'll need to:
- Contact us through 1teamsoftware.com to get access to the complete solution
- Configure your npm registry credentials
- Install the package:
pnpm add @licensehub/license-clientBasic Usage
Initialize the client:
import { LicenseClient } from '@licensehub/license-client';
const client = new LicenseClient();Set License Payload
You can set the license payload once and reuse it across multiple operations:
client.setLicensePayload({
licenseKey: 'YOUR-LICENSE-KEY',
domain: 'example.com'
});
// Now you can call operations without providing payload
const response = await client.validate();Validate a License
// With explicit payload
const response = await client.validate({
licenseKey: 'YOUR-LICENSE-KEY',
domain: 'example.com'
});
// Or using previously set payload
const response = await client.validate();
if (response.success) {
console.log('License is valid');
} else {
console.error('License validation failed:', response.messages);
}Activate a License
// With explicit payload
const response = await client.activate({
licenseKey: 'YOUR-LICENSE-KEY',
domain: 'example.com',
ipAddress: '192.168.1.1'
});
// Or using previously set payload
const response = await client.activate();
if (response.success) {
console.log('License activated successfully');
} else {
console.error('License activation failed:', response.messages);
}Deactivate a License
// With explicit payload
const response = await client.deactivate({
licenseKey: 'YOUR-LICENSE-KEY',
domain: 'example.com'
});
// Or using previously set payload
const response = await client.deactivate();
if (response.success) {
console.log('License deactivated successfully');
} else {
console.error('License deactivation failed:', response.messages);
}All operations return a typed Response object with:
success: boolean indicating operation successmessages: array of message objects with code and textdata: optional response data (type varies by operation)
Advanced Features
Automatic Caching
The client implements intelligent caching for all license operations:
- Successful responses are cached by operation type
- Cache is automatically invalidated when needed (e.g., deactivation invalidates activation cache)
- Reduces server load and improves application performance
Singleton Pattern
The LicenseClient implements a singleton pattern to ensure a single instance across your application:
import { LicenseClientSingleton } from '@licensehub/license-client';
// Get or create the singleton instance
const client = LicenseClientSingleton.getInstance() || new LicenseClient();
// Set the singleton instance
LicenseClientSingleton.setInstance(client);
// Use the singleton instance
const response = await LicenseClientSingleton.getInstance()?.validate();Benefits of using the singleton pattern:
- Ensures consistent license state across your application
- Prevents multiple instances from conflicting with each other
- Simplifies license management in complex applications
Error Handling
The client provides detailed error information:
- Network-related errors (server unreachable, timeout)
- License-specific errors (invalid, expired, exceeded activations)
- Validation failures with specific error codes and messages
Key Features
✅ Type-Safe Implementation - Built with TypeScript for maximum type safety and developer experience
✅ Flexible Licensing Models - Support for perpetual, subscription, and trial licenses
✅ Usage Control - Limit activations per license and track usage patterns
✅ Secure Validation - Cryptographic verification of license authenticity
✅ Custom Restrictions - Define custom usage limits and expiration policies
✅ Detailed Analytics - Track license usage and activation history
Learn More
Visit 1teamsoftware.com for additional resources.
License
This package is proprietary software owned by 1TeamSoftware. All rights reserved. Usage is subject to the terms of our Proprietary Software License Agreement which prohibits copying, modification, distribution, or creation of derivative works. See LICENSE for the complete terms and conditions.