SDKs overview
License-API offers a suite of Software Development Kits (SDKs) designed to simplify the integration of its licensing and entitlement management capabilities into various applications. These SDKs abstract the underlying RESTful API, providing developers with idiomatic access to features such as license creation, validation, activation, deactivation, and usage tracking. The availability of official SDKs for multiple programming languages aims to reduce implementation complexity and accelerate development cycles for common licensing use cases License-API documentation.
Integrating with License-API through an SDK allows developers to manage software licenses, implement subscription key generation, secure product activation, and facilitate usage-based billing models programmatically. The SDKs handle aspects such as HTTP requests, response parsing, and error handling, enabling developers to focus on their application's core logic rather than the intricacies of API communication. This approach is consistent with common API integration strategies, which often leverage SDKs for developer convenience Google Cloud SDK overview.
Official SDKs by language
License-API maintains official SDKs for widely used programming languages, ensuring direct support and continuous updates. These SDKs are typically hosted on their respective language package managers or version control platforms, facilitating easy installation and dependency management. The official SDKs are the recommended method for integrating with the License-API platform, offering stability and comprehensive feature coverage aligned with the API's capabilities.
The following table outlines the official SDKs provided by License-API:
| Language | Package Name | Maturity |
|---|---|---|
| Python | licenseapi-python |
Stable |
| Node.js | @license-api/client |
Stable |
| PHP | license-api/php-client |
Stable |
| Ruby | license_api |
Stable |
| Go | github.com/license-api/go-sdk |
Stable |
| C# | LicenseApi.Client |
Stable |
| Java | com.licenseapi:java-client |
Stable |
Installation
Installing the License-API SDKs typically involves using the standard package manager for each specific programming language. Below are common installation commands for the primary supported languages. Developers should refer to the official License-API installation documentation for the most up-to-date and specific instructions, including any prerequisites or environment configurations.
Python
The Python SDK can be installed using pip:
pip install licenseapi-python
Node.js
For Node.js projects, use npm or yarn:
npm install @license-api/client
# or
yarn add @license-api/client
PHP
PHP projects typically use Composer for dependency management:
composer require license-api/php-client
Ruby
The Ruby SDK is available as a gem:
gem install license_api
Go
Go modules can be used to add the SDK to your project:
go get github.com/license-api/go-sdk
C#
For C# applications, use NuGet Package Manager:
Install-Package LicenseApi.Client
Java
For Java projects using Maven, add the dependency to your pom.xml:
<dependency>
<groupId>com.licenseapi</groupId>
<artifactId>java-client</artifactId>
<version>1.0.0</version> <!-- Replace with the latest version -->
</dependency>
For Gradle:
implementation 'com.licenseapi:java-client:1.0.0' // Replace with the latest version
Quickstart example
This quickstart demonstrates how to initialize the License-API client and validate a license key using the Python SDK. Similar logic applies to other language SDKs, though syntax may vary. This example assumes you have your API key and a license key ready for validation. For a comprehensive list of API operations, consult the License-API API reference documentation.
Python Quickstart
First, ensure the licenseapi-python SDK is installed (pip install licenseapi-python).
from licenseapi import Client
# Replace with your actual API Key from License-API dashboard
API_KEY = "YOUR_LICENSE_API_KEY"
# Replace with the license key you want to validate
LICENSE_KEY_TO_VALIDATE = "YOUR_PRODUCT_LICENSE_KEY"
def validate_license():
try:
# Initialize the License-API client with your API key
client = Client(api_key=API_KEY)
# Validate the license key
validation_result = client.licenses.validate(key=LICENSE_KEY_TO_VALIDATE)
if validation_result.is_valid:
print(f"License '{LICENSE_KEY_TO_VALIDATE}' is valid.")
print(f"Product Name: {validation_result.product.name}")
print(f"Expiry Date: {validation_result.expires_at}")
# Access other license details as needed
else:
print(f"License '{LICENSE_KEY_TO_VALIDATE}' is INVALD.")
print(f"Reason: {validation_result.reason_code}")
except Exception as e:
print(f"An error occurred during license validation: {e}")
if __name__ == "__main__":
validate_license()
Node.js Quickstart
First, ensure the @license-api/client SDK is installed (npm install @license-api/client).
const LicenseAPI = require('@license-api/client');
// Replace with your actual API Key from License-API dashboard
const API_KEY = "YOUR_LICENSE_API_KEY";
// Replace with the license key you want to validate
const LICENSE_KEY_TO_VALIDATE = "YOUR_PRODUCT_LICENSE_KEY";
async function validateLicense() {
try {
// Initialize the License-API client with your API key
const client = new LicenseAPI.Client(API_KEY);
// Validate the license key
const validationResult = await client.licenses.validate(LICENSE_KEY_TO_VALIDATE);
if (validationResult.isValid) {
console.log(`License '${LICENSE_KEY_TO_VALIDATE}' is valid.`);
console.log(`Product Name: ${validationResult.product.name}`);
console.log(`Expiry Date: ${validationResult.expiresAt}`);
// Access other license details as needed
} else {
console.log(`License '${LICENSE_KEY_TO_VALIDATE}' is INVALID.`);
console.log(`Reason: ${validationResult.reasonCode}`);
}
} catch (error) {
console.error(`An error occurred during license validation: ${error.message}`);
}
}
validateLicense();
Community libraries
While License-API provides a robust set of official SDKs for major programming languages, the open nature of APIs frequently encourages the development of community-contributed libraries. These libraries, often developed by individual developers or smaller groups, can offer alternative approaches, specialized integrations, or support for niche platforms not covered by official SDKs. Community libraries may vary in terms of maintenance, documentation quality, and feature completeness compared to official offerings.
Developers seeking to integrate License-API into environments or languages not officially supported should explore community-driven efforts. Resources such as GitHub, package managers (e.g., PyPI, npm, RubyGems), and technical forums are common places to discover such contributions. Before relying on a community library for production systems, it is generally recommended to evaluate its active development, issue tracking, and community support. The Mozilla Developer Network's API client definition provides context on the role of client libraries in API interactions.
As of the current date, License-API's official documentation primarily highlights its own SDKs. Any community-maintained libraries would typically be discovered through broader community channels or by searching for relevant keywords on code hosting platforms. Developers are encouraged to check the official License-API community forums or documentation for any mentions of third-party tools that have gained traction or official endorsement for specific use cases.