Official C++ SDK for LicenseChain - Secure license management for C++ applications.
- � Secure Authentication - User registration, login, and session management
- 📜 License Management - Create, validate, update, and revoke licenses
- 🛡� Hardware ID Validation - Prevent license sharing and unauthorized access
- 🔔 Webhook Support - Real-time license events and notifications
- 📊 Analytics Integration - Track license usage and performance metrics
- âš¡ High Performance - Optimized for production workloads
- 🔄 Async Operations - Non-blocking HTTP requests and data processing
- 🛠� Easy Integration - Simple API with comprehensive documentation
The C++ SDK exposes licensechain::LICENSE_TOKEN_USE_CLAIM in include/licensechain/license_assertion.h for claim-name parity with the Core API. Fetch GET /v1/licenses/jwks, select the JWK by JWT kid, and verify RS256 with your preferred crypto stack (OpenSSL, etc.), or delegate verification to a backend. Default API base: https://api.licensechain.app/v1.
# Clone the repository
git clone https://github.com/LicenseChain/LicenseChain-CPP-SDK.git
cd LicenseChain-CPP-SDK
# Create build directory
mkdir build && cd build
# Configure with CMake
cmake ..
# Build the library
make -j$(nproc)
# Install (optional)
sudo make installAdd to your CMakeLists.txt:
find_package(LicenseChain REQUIRED)
target_link_libraries(your_target LicenseChain::LicenseChain)- Download the latest release from GitHub Releases
- Extract the headers and libraries to your project
- Link against the LicenseChain library
#include <licensechain/licensechain_client.h>
#include <iostream>
int main() {
// Initialize API client
licensechain::LicenseChainClient client(
"your-api-key",
"https://api.licensechain.app",
30
);
// Example: health endpoint (via GetHealthCheckAsync)
auto healthFuture = client.GetHealthCheckAsync();
auto health = healthFuture.get();
std::cout << "Health status request completed." << std::endl;
return 0;
}LicenseChain::UserRegistrationRequest registerRequest;
registerRequest.email = "email@example.com";
registerRequest.password = "strong-password";
registerRequest.name = "Example User";
auto user = client.RegisterUserAsync(registerRequest).get();
std::cout << "User registered: " << user.email << std::endl;auto validation = client.ValidateLicenseAsync("LICENSE-KEY-HERE").get();
std::cout << "Valid: " << (validation.valid ? "true" : "false") << std::endl;
auto stats = client.GetAnalyticsAsync(LicenseChain::AnalyticsRequest{}).get();
std::cout << "Analytics request completed." << std::endl;licensechain::LicenseChainClient client(
"your-api-key",
"https://api.licensechain.app",
30
);// Register a new user
auto result = client.RegisterUserAsync(request).get();
// Get current user info
auto user = client.GetUserProfileAsync().get();// Validate a license
auto result = client.ValidateLicenseAsync(licenseKey).get();
// Create a new license
auto result = client.CreateLicenseAsync(request).get();
// Update a license
auto result = client.UpdateLicenseAsync(licenseId, request).get();
// Revoke a license
client.RevokeLicenseAsync(licenseId).get();
// Extend a license
client.ExtendLicenseAsync(licenseId, "2027-01-01T00:00:00Z").get();// Get analytics data
auto result = client.GetAnalyticsAsync(request).get();Set these in your environment or through your build process:
# Required
export LICENSECHAIN_API_KEY=your-api-key
# Optional
export LICENSECHAIN_BASE_URL=https://api.licensechain.app
export LICENSECHAIN_DEBUG=truelicensechain::LicenseChainClient client(
"your-api-key",
"https://api.licensechain.app",
30
);- All API requests use HTTPS
- API keys are securely stored and transmitted
- Webhook signatures are verified
- Real-time license validation
- Expiration checking
auto analytics = client.GetAnalyticsAsync(request).get();
auto usage = client.GetUsageStatsAsync(request).get();try {
auto result = client.ValidateLicenseAsync("invalid-key").get();
(void)result;
} catch (const LicenseChain::ValidationException& e) {
std::cerr << "Validation error: " << e.what() << std::endl;
} catch (const LicenseChain::NetworkException& e) {
std::cerr << "Network error: " << e.what() << std::endl;
} catch (const LicenseChain::LicenseChainException& e) {
std::cerr << "LicenseChain error: " << e.what() << std::endl;
} catch (const std::exception& e) {
std::cerr << "Exception: " << e.what() << std::endl;
}// Configure timeout at client construction
licensechain::LicenseChainClient client(
"your-api-key",
"https://api.licensechain.app",
30
);# Run tests
cd build
ctest --output-on-failureIntegration tests are repository-specific and may not be present in all snapshots.
See the examples/ directory for complete examples:
basic_usage.cpp- Basic SDK usageadvanced_features.cpp- Advanced features and configurationwebhook_integration.cpp- Webhook handling
We welcome contributions! Please see our Contributing Guide for details.
- Clone the repository
- Install dependencies:
sudo apt-get install libcurl4-openssl-dev - Build:
mkdir build && cd build && cmake .. && make - Test:
ctest
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: https://docs.licensechain.app/cpp
- Issues: GitHub Issues
- Discord: LicenseChain Discord
- Email: support@licensechain.app
- LicenseChain JavaScript SDK
- LicenseChain Python SDK
- LicenseChain Node.js SDK
- LicenseChain Customer Panel
Made with �� for the C++ community
All endpoints automatically use the /v1 prefix when connecting to https://api.licensechain.app.
- Production: https://api.licensechain.app/v1
- Development: https://api.licensechain.app/v1
| Method | Endpoint | Description |
|---|---|---|
| GET | /v1/health | Health check |
| POST | /v1/auth/register | User registration |
| GET | /v1/auth/me | Current authenticated user |
| GET | /v1/apps | List applications |
| POST | /v1/apps/:id/licenses | Create license for app |
| POST | /v1/licenses/verify | Verify license |
| PATCH | /v1/licenses/:id/revoke | Revoke license |
| PATCH | /v1/licenses/:id/activate | Activate license |
| PATCH | /v1/licenses/:id/extend | Extend license |
| GET | /v1/webhooks | List webhooks |
| POST | /v1/webhooks | Create webhook |
| GET | /v1/analytics/stats | Get analytics |
Note: The SDK automatically prepends /v1 to all endpoints.
This SDK targets the LicenseChain HTTP API v1 implemented by the open-source API service.
- Production base URL: https://api.licensechain.app/v1
- API repository (source of routes & behavior): https://github.com/LicenseChain/api
- Baseline REST mapping (documented for integrators):
- GET /health
- POST /auth/register
- POST /licenses/verify
- PATCH /licenses/:id/revoke
- PATCH /licenses/:id/activate
- PATCH /licenses/:id/extend
- GET /analytics/stats