{"id":46995732,"url":"https://github.com/licensechain/licensechain-cpp-sdk","last_synced_at":"2026-03-11T15:02:58.573Z","repository":{"id":316821157,"uuid":"1064679847","full_name":"LicenseChain/LicenseChain-CPP-SDK","owner":"LicenseChain","description":null,"archived":false,"fork":false,"pushed_at":"2025-09-26T21:57:56.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-26T23:36:50.874Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LicenseChain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-26T11:48:07.000Z","updated_at":"2025-09-26T21:58:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"7b33d22e-d252-479c-97e0-9c8b2f9c0ce6","html_url":"https://github.com/LicenseChain/LicenseChain-CPP-SDK","commit_stats":null,"previous_names":["licensechain/licensechain-cpp-sdk"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/LicenseChain/LicenseChain-CPP-SDK","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LicenseChain%2FLicenseChain-CPP-SDK","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LicenseChain%2FLicenseChain-CPP-SDK/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LicenseChain%2FLicenseChain-CPP-SDK/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LicenseChain%2FLicenseChain-CPP-SDK/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LicenseChain","download_url":"https://codeload.github.com/LicenseChain/LicenseChain-CPP-SDK/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LicenseChain%2FLicenseChain-CPP-SDK/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30385034,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T14:10:17.325Z","status":"ssl_error","status_checked_at":"2026-03-11T14:09:37.934Z","response_time":84,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-11T15:02:52.644Z","updated_at":"2026-03-11T15:02:58.563Z","avatar_url":"https://github.com/LicenseChain.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# LicenseChain C++ SDK\n\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n[![C++](https://img.shields.io/badge/C++-17+-blue.svg)](https://en.cppreference.com/)\n[![CMake](https://img.shields.io/badge/CMake-3.10+-green.svg)](https://cmake.org/)\n\nOfficial C++ SDK for LicenseChain - Secure license management for C++ applications.\n\n## ðŸš€ Features\n\n- **ðŸ” Secure Authentication** - User registration, login, and session management\n- **ðŸ“œ License Management** - Create, validate, update, and revoke licenses\n- **ðŸ›¡ï¸ Hardware ID Validation** - Prevent license sharing and unauthorized access\n- **ðŸ”” Webhook Support** - Real-time license events and notifications\n- **ðŸ“Š Analytics Integration** - Track license usage and performance metrics\n- **âš¡ High Performance** - Optimized for production workloads\n- **ðŸ”„ Async Operations** - Non-blocking HTTP requests and data processing\n- **ðŸ› ï¸ Easy Integration** - Simple API with comprehensive documentation\n\n## ðŸ“¦ Installation\n\n### Method 1: CMake (Recommended)\n\n```bash\n# Clone the repository\ngit clone https://github.com/LicenseChain/LicenseChain-CPP-SDK.git\ncd LicenseChain-CPP-SDK\n\n# Create build directory\nmkdir build \u0026\u0026 cd build\n\n# Configure with CMake\ncmake ..\n\n# Build the library\nmake -j$(nproc)\n\n# Install (optional)\nsudo make install\n```\n\n### Method 2: Package Manager\n\nAdd to your `CMakeLists.txt`:\n\n```cmake\nfind_package(LicenseChain REQUIRED)\ntarget_link_libraries(your_target LicenseChain::LicenseChain)\n```\n\n### Method 3: Manual Installation\n\n1. Download the latest release from [GitHub Releases](https://github.com/LicenseChain/LicenseChain-CPP-SDK/releases)\n2. Extract the headers and libraries to your project\n3. Link against the LicenseChain library\n\n## ðŸš€ Quick Start\n\n### Basic Setup\n\n```cpp\n#include \u003clicensechain/licensechain_client.h\u003e\n#include \u003ciostream\u003e\n\nint main() {\n    // Initialize the client\n    LicenseChain::Client client({\n        .apiKey = \"your-api-key\",\n        .appName = \"your-app-name\",\n        .version = \"1.0.0\"\n    });\n    \n    // Connect to LicenseChain\n    auto result = client.connect();\n    if (!result.success) {\n        std::cerr \u003c\u003c \"Failed to connect to LicenseChain: \" \u003c\u003c result.error \u003c\u003c std::endl;\n        return 1;\n    }\n    \n    std::cout \u003c\u003c \"Connected to LicenseChain successfully!\" \u003c\u003c std::endl;\n    return 0;\n}\n```\n\n### User Authentication\n\n```cpp\n// Register a new user\nauto registerResult = client.register(\"username\", \"password\", \"email@example.com\");\nif (registerResult.success) {\n    std::cout \u003c\u003c \"User registered successfully!\" \u003c\u003c std::endl;\n} else {\n    std::cerr \u003c\u003c \"Registration failed: \" \u003c\u003c registerResult.error \u003c\u003c std::endl;\n}\n\n// Login existing user\nauto loginResult = client.login(\"username\", \"password\");\nif (loginResult.success) {\n    std::cout \u003c\u003c \"User logged in successfully!\" \u003c\u003c std::endl;\n    std::cout \u003c\u003c \"Session ID: \" \u003c\u003c loginResult.sessionId \u003c\u003c std::endl;\n} else {\n    std::cerr \u003c\u003c \"Login failed: \" \u003c\u003c loginResult.error \u003c\u003c std::endl;\n}\n```\n\n### License Management\n\n```cpp\n// Validate a license\nauto validateResult = client.validateLicense(\"LICENSE-KEY-HERE\");\nif (validateResult.success) {\n    std::cout \u003c\u003c \"License is valid!\" \u003c\u003c std::endl;\n    std::cout \u003c\u003c \"License Key: \" \u003c\u003c validateResult.license.key \u003c\u003c std::endl;\n    std::cout \u003c\u003c \"Status: \" \u003c\u003c validateResult.license.status \u003c\u003c std::endl;\n    std::cout \u003c\u003c \"Expires: \" \u003c\u003c validateResult.license.expires \u003c\u003c std::endl;\n    std::cout \u003c\u003c \"Features: \";\n    for (const auto\u0026 feature : validateResult.license.features) {\n        std::cout \u003c\u003c feature \u003c\u003c \" \";\n    }\n    std::cout \u003c\u003c std::endl;\n    std::cout \u003c\u003c \"User: \" \u003c\u003c validateResult.license.user \u003c\u003c std::endl;\n} else {\n    std::cerr \u003c\u003c \"License validation failed: \" \u003c\u003c validateResult.error \u003c\u003c std::endl;\n}\n\n// Get user's licenses\nauto licensesResult = client.getUserLicenses();\nif (licensesResult.success) {\n    std::cout \u003c\u003c \"Found \" \u003c\u003c licensesResult.licenses.size() \u003c\u003c \" licenses:\" \u003c\u003c std::endl;\n    for (size_t i = 0; i \u003c licensesResult.licenses.size(); ++i) {\n        const auto\u0026 license = licensesResult.licenses[i];\n        std::cout \u003c\u003c \"  \" \u003c\u003c (i + 1) \u003c\u003c \". \" \u003c\u003c license.key \n                  \u003c\u003c \" - \" \u003c\u003c license.status \n                  \u003c\u003c \" (Expires: \" \u003c\u003c license.expires \u003c\u003c \")\" \u003c\u003c std::endl;\n    }\n}\n```\n\n### Hardware ID Validation\n\n```cpp\n// Get hardware ID (automatically generated)\nstd::string hardwareId = client.getHardwareId();\nstd::cout \u003c\u003c \"Hardware ID: \" \u003c\u003c hardwareId \u003c\u003c std::endl;\n\n// Validate hardware ID with license\nauto hardwareResult = client.validateHardwareId(\"LICENSE-KEY-HERE\", hardwareId);\nif (hardwareResult.success) {\n    std::cout \u003c\u003c \"Hardware ID is valid for this license!\" \u003c\u003c std::endl;\n} else {\n    std::cerr \u003c\u003c \"Hardware ID validation failed: \" \u003c\u003c hardwareResult.error \u003c\u003c std::endl;\n}\n```\n\n### Webhook Integration\n\n```cpp\n// Set up webhook handler\nclient.setWebhookHandler([](const std::string\u0026 event, const std::map\u003cstd::string, std::string\u003e\u0026 data) {\n    std::cout \u003c\u003c \"Webhook received: \" \u003c\u003c event \u003c\u003c std::endl;\n    \n    if (event == \"license.created\") {\n        std::cout \u003c\u003c \"New license created: \" \u003c\u003c data.at(\"licenseKey\") \u003c\u003c std::endl;\n    } else if (event == \"license.updated\") {\n        std::cout \u003c\u003c \"License updated: \" \u003c\u003c data.at(\"licenseKey\") \u003c\u003c std::endl;\n    } else if (event == \"license.revoked\") {\n        std::cout \u003c\u003c \"License revoked: \" \u003c\u003c data.at(\"licenseKey\") \u003c\u003c std::endl;\n    }\n});\n\n// Start webhook listener\nclient.startWebhookListener();\n```\n\n## ðŸ“š API Reference\n\n### LicenseChain::Client\n\n#### Constructor\n\n```cpp\nLicenseChain::Client client({\n    .apiKey = \"your-api-key\",\n    .appName = \"your-app-name\",\n    .version = \"1.0.0\",\n    .baseUrl = \"https://api.licensechain.app\"  // Optional\n});\n```\n\n#### Methods\n\n##### Connection Management\n\n```cpp\n// Connect to LicenseChain\nauto result = client.connect();\n\n// Disconnect from LicenseChain\nclient.disconnect();\n\n// Check connection status\nbool isConnected = client.isConnected();\n```\n\n##### User Authentication\n\n```cpp\n// Register a new user\nauto result = client.register(username, password, email);\n\n// Login existing user\nauto result = client.login(username, password);\n\n// Logout current user\nclient.logout();\n\n// Get current user info\nauto user = client.getCurrentUser();\n```\n\n##### License Management\n\n```cpp\n// Validate a license\nauto result = client.validateLicense(licenseKey);\n\n// Get user's licenses\nauto result = client.getUserLicenses();\n\n// Create a new license\nauto result = client.createLicense(userId, features, expires);\n\n// Update a license\nauto result = client.updateLicense(licenseKey, updates);\n\n// Revoke a license\nauto result = client.revokeLicense(licenseKey);\n\n// Extend a license\nauto result = client.extendLicense(licenseKey, days);\n```\n\n##### Hardware ID Management\n\n```cpp\n// Get hardware ID\nstd::string hardwareId = client.getHardwareId();\n\n// Validate hardware ID\nauto result = client.validateHardwareId(licenseKey, hardwareId);\n\n// Bind hardware ID to license\nauto result = client.bindHardwareId(licenseKey, hardwareId);\n```\n\n##### Webhook Management\n\n```cpp\n// Set webhook handler\nclient.setWebhookHandler(handler);\n\n// Start webhook listener\nclient.startWebhookListener();\n\n// Stop webhook listener\nclient.stopWebhookListener();\n```\n\n##### Analytics\n\n```cpp\n// Track event\nclient.trackEvent(eventName, properties);\n\n// Get analytics data\nauto result = client.getAnalytics(timeRange);\n```\n\n## ðŸ”§ Configuration\n\n### Environment Variables\n\nSet these in your environment or through your build process:\n\n```bash\n# Required\nexport LICENSECHAIN_API_KEY=your-api-key\nexport LICENSECHAIN_APP_NAME=your-app-name\nexport LICENSECHAIN_APP_VERSION=1.0.0\n\n# Optional\nexport LICENSECHAIN_BASE_URL=https://api.licensechain.app\nexport LICENSECHAIN_DEBUG=true\n```\n\n### Advanced Configuration\n\n```cpp\nLicenseChain::Client client({\n    .apiKey = \"your-api-key\",\n    .appName = \"your-app-name\",\n    .version = \"1.0.0\",\n    .baseUrl = \"https://api.licensechain.app\",\n    .timeout = 30, // Request timeout in seconds\n    .retries = 3,  // Number of retry attempts\n    .debug = false // Enable debug logging\n});\n```\n\n## ðŸ›¡ï¸ Security Features\n\n### Hardware ID Protection\n\nThe SDK automatically generates and manages hardware IDs to prevent license sharing:\n\n```cpp\n// Hardware ID is automatically generated and stored\nstd::string hardwareId = client.getHardwareId();\n\n// Validate against license\nauto isValid = client.validateHardwareId(licenseKey, hardwareId);\n```\n\n### Secure Communication\n\n- All API requests use HTTPS\n- API keys are securely stored and transmitted\n- Session tokens are automatically managed\n- Webhook signatures are verified\n\n### License Validation\n\n- Real-time license validation\n- Hardware ID binding\n- Expiration checking\n- Feature-based access control\n\n## ðŸ“Š Analytics and Monitoring\n\n### Event Tracking\n\n```cpp\n// Track custom events\nclient.trackEvent(\"app.started\", {\n    {\"level\", 1},\n    {\"playerCount\", 10}\n});\n\n// Track license events\nclient.trackEvent(\"license.validated\", {\n    {\"licenseKey\", \"LICENSE-KEY\"},\n    {\"features\", \"premium,unlimited\"}\n});\n```\n\n### Performance Monitoring\n\n```cpp\n// Get performance metrics\nauto metrics = client.getPerformanceMetrics();\nstd::cout \u003c\u003c \"API Response Time: \" \u003c\u003c metrics.avgResponseTime \u003c\u003c \"ms\" \u003c\u003c std::endl;\nstd::cout \u003c\u003c \"Success Rate: \" \u003c\u003c (metrics.successRate * 100) \u003c\u003c \"%\" \u003c\u003c std::endl;\nstd::cout \u003c\u003c \"Error Count: \" \u003c\u003c metrics.errorCount \u003c\u003c std::endl;\n```\n\n## ðŸ”„ Error Handling\n\n### Custom Error Types\n\n```cpp\ntry {\n    auto result = client.validateLicense(\"invalid-key\");\n    if (!result.success) {\n        switch (result.errorType) {\n            case LicenseChain::ErrorType::INVALID_LICENSE:\n                std::cerr \u003c\u003c \"License key is invalid\" \u003c\u003c std::endl;\n                break;\n            case LicenseChain::ErrorType::EXPIRED_LICENSE:\n                std::cerr \u003c\u003c \"License has expired\" \u003c\u003c std::endl;\n                break;\n            case LicenseChain::ErrorType::NETWORK_ERROR:\n                std::cerr \u003c\u003c \"Network connection failed\" \u003c\u003c std::endl;\n                break;\n        }\n    }\n} catch (const std::exception\u0026 e) {\n    std::cerr \u003c\u003c \"Exception: \" \u003c\u003c e.what() \u003c\u003c std::endl;\n}\n```\n\n### Retry Logic\n\n```cpp\n// Automatic retry for network errors\nLicenseChain::Client client({\n    .apiKey = \"your-api-key\",\n    .appName = \"your-app-name\",\n    .version = \"1.0.0\",\n    .retries = 3, // Retry up to 3 times\n    .retryDelay = 1000 // Wait 1 second between retries\n});\n```\n\n## ðŸ§ª Testing\n\n### Unit Tests\n\n```bash\n# Run tests\ncd build\nctest --output-on-failure\n```\n\n### Integration Tests\n\n```bash\n# Test with real API\n./tests/integration_tests\n```\n\n## ðŸ“ Examples\n\nSee the `examples/` directory for complete examples:\n\n- `basic_usage.cpp` - Basic SDK usage\n- `advanced_features.cpp` - Advanced features and configuration\n- `webhook_integration.cpp` - Webhook handling\n\n## ðŸ¤ Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n### Development Setup\n\n1. Clone the repository\n2. Install dependencies: `sudo apt-get install libcurl4-openssl-dev`\n3. Build: `mkdir build \u0026\u0026 cd build \u0026\u0026 cmake .. \u0026\u0026 make`\n4. Test: `ctest`\n\n## ðŸ“„ License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## ðŸ†˜ Support\n\n- **Documentation**: [https://docs.licensechain.app/cpp](https://docs.licensechain.app/cpp)\n- **Issues**: [GitHub Issues](https://github.com/LicenseChain/LicenseChain-CPP-SDK/issues)\n- **Discord**: [LicenseChain Discord](https://discord.gg/licensechain)\n- **Email**: support@licensechain.app\n\n## ðŸ”— Related Projects\n\n- [LicenseChain JavaScript SDK](https://github.com/LicenseChain/LicenseChain-JavaScript-SDK)\n- [LicenseChain Python SDK](https://github.com/LicenseChain/LicenseChain-Python-SDK)\n- [LicenseChain Node.js SDK](https://github.com/LicenseChain/LicenseChain-NodeJS-SDK)\n- [LicenseChain Customer Panel](https://github.com/LicenseChain/LicenseChain-Customer-Panel)\n\n---\n\n**Made with â¤ï¸ for the C++ community**\n\n\n## API Endpoints\n\nAll endpoints automatically use the /v1 prefix when connecting to https://api.licensechain.app.\n\n### Base URL\n- **Production**: https://api.licensechain.app/v1\\n- **Development**: https://api.licensechain.app/v1\\n\\n### Available Endpoints\\n\\n| Method | Endpoint | Description |\\n|--------|----------|-------------|\\n| GET | /v1/health | Health check |\\n| POST | /v1/auth/login | User login |\\n| POST | /v1/auth/register | User registration |\\n| GET | /v1/apps | List applications |\\n| POST | /v1/apps | Create application |\\n| GET | /v1/licenses | List licenses |\\n| POST | /v1/licenses/verify | Verify license |\\n| GET | /v1/webhooks | List webhooks |\\n| POST | /v1/webhooks | Create webhook |\\n| GET | /v1/analytics | Get analytics |\\n\\n**Note**: The SDK automatically prepends /v1 to all endpoints, so you only need to specify the path (e.g., /auth/login instead of /v1/auth/login).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flicensechain%2Flicensechain-cpp-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flicensechain%2Flicensechain-cpp-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flicensechain%2Flicensechain-cpp-sdk/lists"}