LicenseChain.VB.SDK 1.0.2

dotnet add package LicenseChain.VB.SDK --version 1.0.2
                    
NuGet\Install-Package LicenseChain.VB.SDK -Version 1.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LicenseChain.VB.SDK" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LicenseChain.VB.SDK" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="LicenseChain.VB.SDK" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LicenseChain.VB.SDK --version 1.0.2
                    
#r "nuget: LicenseChain.VB.SDK, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LicenseChain.VB.SDK@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LicenseChain.VB.SDK&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=LicenseChain.VB.SDK&version=1.0.2
                    
Install as a Cake Tool

LicenseChain VB.NET SDK

License VB.NET .NET

Official VB.NET SDK for LicenseChain - Secure license management for VB.NET applications.

๐Ÿš€ Features

  • ๐Ÿ” 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

License assertion JWT (RS256 + JWKS)

API base: https://api.licensechain.app/v1

Successful POST /v1/licenses/verify may include license_token, license_token_expires_at, and license_jwks_uri. The JWT must carry token_use = licensechain_license_v1.

RS256 + JWKS: Verify using keys from GET /v1/licenses/jwks (or the returned license_jwks_uri). Use VerifyLicenseAssertionJwtAsync from the shared .NET stack (same as C#).

Runnable (this repo): dotnet run --project examples/jwks_only/jwks_only.vbproj with LICENSECHAIN_LICENSE_TOKEN and LICENSECHAIN_LICENSE_JWKS_URI (optional LICENSECHAIN_EXPECTED_APP_ID). C# reference: LicenseChain-CSharp-SDK/examples/jwks_only. See THIN_CLIENT_PARITY.

๐Ÿ“ฆ Installation

# Install via Package Manager Console
Install-Package LicenseChain.VB.SDK

# Or via .NET CLI
dotnet add package LicenseChain.VB.SDK --version 1.0.2

Method 2: PackageReference

Add to your .vbproj:

<PackageReference Include="LicenseChain.VB.SDK" Version="1.0.2" />

Method 3: Manual Installation

  1. Download the latest release from GitHub Releases
  2. Add the DLL reference to your project
  3. Install required dependencies

๐Ÿš€ Quick Start

Basic Setup

Imports LicenseChain.VB

Module Program
    Async Function Main(args As String()) As Task
        ' Initialize the client
        Dim client As New LicenseChainClient(New LicenseChainConfig With {
            .ApiKey = "your-api-key",
            .AppName = "your-app-name",
            .Version = "1.0.0"
        })
        
        ' Connect to LicenseChain
        Try
            Await client.ConnectAsync()
            Console.WriteLine("Connected to LicenseChain successfully!")
        Catch ex As LicenseChainException
            Console.WriteLine($"Failed to connect: {ex.Message}")
            Return
        End Try
    End Function
End Module

User Authentication

' Register a new user
Try
    Dim user As User = Await client.RegisterAsync("username", "password", "email@example.com")
    Console.WriteLine("User registered successfully!")
    Console.WriteLine($"User ID: {user.Id}")
Catch ex As LicenseChainException
    Console.WriteLine($"Registration failed: {ex.Message}")
End Try

' Login existing user
Try
    Dim user As User = Await client.LoginAsync("username", "password")
    Console.WriteLine("User logged in successfully!")
    Console.WriteLine($"Session ID: {user.SessionId}")
Catch ex As LicenseChainException
    Console.WriteLine($"Login failed: {ex.Message}")
End Try

License Management

' Validate a license
Try
    Dim license As License = Await client.ValidateLicenseAsync("LICENSE-KEY-HERE")
    Console.WriteLine("License is valid!")
    Console.WriteLine($"License Key: {license.Key}")
    Console.WriteLine($"Status: {license.Status}")
    Console.WriteLine($"Expires: {license.Expires}")
    Console.WriteLine($"Features: {String.Join(", ", license.Features)}")
    Console.WriteLine($"User: {license.User}")
Catch ex As LicenseChainException
    Console.WriteLine($"License validation failed: {ex.Message}")
End Try

' Get user's licenses
Try
    Dim licenses As List(Of License) = Await client.GetUserLicensesAsync()
    Console.WriteLine($"Found {licenses.Count} licenses:")
    For i As Integer = 0 To licenses.Count - 1
        Dim license As License = licenses(i)
        Console.WriteLine($"  {i + 1}. {license.Key} - {license.Status} (Expires: {license.Expires})")
    Next
Catch ex As LicenseChainException
    Console.WriteLine($"Failed to get licenses: {ex.Message}")
End Try

Hardware ID Validation

' Get hardware ID (automatically generated)
Dim hardwareId As String = client.GetHardwareId()
Console.WriteLine($"Hardware ID: {hardwareId}")

' Validate hardware ID with license
Try
    Dim isValid As Boolean = Await client.ValidateHardwareIdAsync("LICENSE-KEY-HERE", hardwareId)
    If isValid Then
        Console.WriteLine("Hardware ID is valid for this license!")
    Else
        Console.WriteLine("Hardware ID is not valid for this license.")
    End If
Catch ex As LicenseChainException
    Console.WriteLine($"Hardware ID validation failed: {ex.Message}")
End Try

Webhook Integration

' Set up webhook handler
client.SetWebhookHandler(Async Function(eventName As String, data As Dictionary(Of String, String))
    Console.WriteLine($"Webhook received: {eventName}")
    
    Select Case eventName
        Case "license.created"
            Console.WriteLine($"New license created: {data("licenseKey")}")
        Case "license.updated"
            Console.WriteLine($"License updated: {data("licenseKey")}")
        Case "license.revoked"
            Console.WriteLine($"License revoked: {data("licenseKey")}")
    End Select
End Function)

' Start webhook listener
Await client.StartWebhookListenerAsync()

๐Ÿ“š API Reference

LicenseChainClient

Constructor
Dim client As New LicenseChainClient(New LicenseChainConfig With {
    .ApiKey = "your-api-key",
    .AppName = "your-app-name",
    .Version = "1.0.0",
    .BaseUrl = "https://api.licensechain.app" ' Optional
})
Methods
Connection Management
' Connect to LicenseChain
Await client.ConnectAsync()

' Disconnect from LicenseChain
Await client.DisconnectAsync()

' Check connection status
Dim isConnected As Boolean = client.IsConnected
User Authentication
' Register a new user
Dim user As User = Await client.RegisterAsync(username, password, email)

' Login existing user
Dim user As User = Await client.LoginAsync(username, password)

' Logout current user
Await client.LogoutAsync()

' Get current user info
Dim user As User = Await client.GetCurrentUserAsync()
License Management
' Validate a license
Dim license As License = Await client.ValidateLicenseAsync(licenseKey)

' Get user's licenses
Dim licenses As List(Of License) = Await client.GetUserLicensesAsync()

' Create a new license
Dim license As License = Await client.CreateLicenseAsync(userId, features, expires)

' Update a license
Dim license As License = Await client.UpdateLicenseAsync(licenseKey, updates)

' Revoke a license
Await client.RevokeLicenseAsync(licenseKey)

' Extend a license
Dim license As License = Await client.ExtendLicenseAsync(licenseKey, days)
Hardware ID Management
' Get hardware ID
Dim hardwareId As String = client.GetHardwareId()

' Validate hardware ID
Dim isValid As Boolean = Await client.ValidateHardwareIdAsync(licenseKey, hardwareId)

' Bind hardware ID to license
Await client.BindHardwareIdAsync(licenseKey, hardwareId)
Webhook Management
' Set webhook handler
client.SetWebhookHandler(handler)

' Start webhook listener
Await client.StartWebhookListenerAsync()

' Stop webhook listener
Await client.StopWebhookListenerAsync()
Analytics
' Track event
Await client.TrackEventAsync(eventName, properties)

' Get analytics data
Dim analytics As Analytics = Await client.GetAnalyticsAsync(timeRange)

๐Ÿ”ง Configuration

App Settings

Add to your appsettings.json:

{
  "LicenseChain": {
    "ApiKey": "your-api-key",
    "AppName": "your-app-name",
    "Version": "1.0.0",
    "BaseUrl": "https://api.licensechain.app",
    "Timeout": 30,
    "Retries": 3,
    "Debug": false
  }
}

Dependency Injection

' In Startup.vb or Program.vb
services.AddLicenseChain(Sub(options)
    options.ApiKey = Configuration("LicenseChain:ApiKey")
    options.AppName = Configuration("LicenseChain:AppName")
    options.Version = Configuration("LicenseChain:Version")
End Sub)

Environment Variables

Set these in your environment or through your build process:

# Required
export LICENSECHAIN_API_KEY=your-api-key
export LICENSECHAIN_APP_NAME=your-app-name
export LICENSECHAIN_APP_VERSION=1.0.0

# Optional
export LICENSECHAIN_BASE_URL=https://api.licensechain.app
export LICENSECHAIN_DEBUG=true

๐Ÿ›ก Security Features

Hardware ID Protection

The SDK automatically generates and manages hardware IDs to prevent license sharing:

' Hardware ID is automatically generated and stored
Dim hardwareId As String = client.GetHardwareId()

' Validate against license
Dim isValid As Boolean = Await client.ValidateHardwareIdAsync(licenseKey, hardwareId)

Secure Communication

  • All API requests use HTTPS
  • API keys are securely stored and transmitted
  • Session tokens are automatically managed
  • Webhook signatures are verified

License Validation

  • Real-time license validation
  • Hardware ID binding
  • Expiration checking
  • Feature-based access control

๐Ÿ“Š Analytics and Monitoring

Event Tracking

' Track custom events
Await client.TrackEventAsync("app.started", New Dictionary(Of String, Object) From {
    {"level", 1},
    {"playerCount", 10}
})

' Track license events
Await client.TrackEventAsync("license.validated", New Dictionary(Of String, Object) From {
    {"licenseKey", "LICENSE-KEY"},
    {"features", "premium,unlimited"}
})

Performance Monitoring

' Get performance metrics
Dim metrics As PerformanceMetrics = Await client.GetPerformanceMetricsAsync()
Console.WriteLine($"API Response Time: {metrics.AverageResponseTime}ms")
Console.WriteLine($"Success Rate: {metrics.SuccessRate:P}")
Console.WriteLine($"Error Count: {metrics.ErrorCount}")

๐Ÿ”„ Error Handling

Custom Exception Types

Try
    Dim license As License = Await client.ValidateLicenseAsync("invalid-key")
Catch ex As InvalidLicenseException
    Console.WriteLine("License key is invalid")
Catch ex As ExpiredLicenseException
    Console.WriteLine("License has expired")
Catch ex As NetworkException
    Console.WriteLine("Network connection failed")
Catch ex As LicenseChainException
    Console.WriteLine($"LicenseChain error: {ex.Message}")
End Try

Retry Logic

' Automatic retry for network errors
Dim client As New LicenseChainClient(New LicenseChainConfig With {
    .ApiKey = "your-api-key",
    .AppName = "your-app-name",
    .Version = "1.0.0",
    .Retries = 3, ' Retry up to 3 times
    .RetryDelay = TimeSpan.FromSeconds(1) ' Wait 1 second between retries
})

๐Ÿงช Testing

Unit Tests

# Run tests
dotnet test

Integration Tests

# Test with real API
dotnet test --filter Category=Integration

๐Ÿ“ Examples

See the examples/ directory for complete examples:

  • BasicUsageExample.vb - Basic SDK usage
  • AdvancedFeaturesExample.vb - Advanced features and configuration
  • WebhookIntegrationExample.vb - Webhook handling

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

  1. Clone the repository
  2. Install .NET 10.0 or later
  3. Build: dotnet build
  4. Test: dotnet test

๐Ÿ“„ License

This project is licensed under the Elastic License 2.0 (ELv2) โ€” see the LICENSE file for details.

๐Ÿ†˜ Support


Made with โค๏ธ for the VB.NET community

API Endpoints

All endpoints automatically use the /v1 prefix when connecting to https://api.licensechain.app.

Base URL

Method Endpoint Description
GET /v1/health Health check
POST /v1/auth/login User login
POST /v1/auth/register User registration
GET /v1/apps List applications
POST /v1/apps Create application
GET /v1/licenses List licenses
POST /v1/licenses/verify Verify license
GET /v1/webhooks List webhooks
POST /v1/webhooks Create webhook
GET /v1/analytics Get analytics

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).

LicenseChain API (v1)

This SDK targets the LicenseChain HTTP API v1 implemented by the LicenseChain API service.

  • Production base URL: https://api.licensechain.app/v1
  • API reference: docs.licensechain.app
  • 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
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 67 10/12/2026
1.0.1 73 10/11/2026