SplatDev.Licensing.Tenant 1.1.14

dotnet add package SplatDev.Licensing.Tenant --version 1.1.14                
NuGet\Install-Package SplatDev.Licensing.Tenant -Version 1.1.14                
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="SplatDev.Licensing.Tenant" Version="1.1.14" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SplatDev.Licensing.Tenant --version 1.1.14                
#r "nuget: SplatDev.Licensing.Tenant, 1.1.14"                
#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.
// Install SplatDev.Licensing.Tenant as a Cake Addin
#addin nuget:?package=SplatDev.Licensing.Tenant&version=1.1.14

// Install SplatDev.Licensing.Tenant as a Cake Tool
#tool nuget:?package=SplatDev.Licensing.Tenant&version=1.1.14                

Licensing Tenant Library for C#

This is the official client library for the Licensing API for C#.

Purpose

In order to manage and validate licenses for your application, you can use the Licensing API. This library provides a simple way to interact with the API and generate new licenses, validate existing licenses, and manage the licensing process. It connects to SplatDev's licensing server and provides a simple way to manage licenses for your application.

Installation

via nuget

Install-Package SplatDev.Licensing.Tenant

Usage

Once installed, you can use the library to interact with the Licensing API.

Tenant.Licensing.NewAsync()

Example:

    var response = await Tenant.Licensing.NewAsync();

This method will connect to the API endpoint and generate a new license. The method returns a License object.

Upon License creation, it must be stored in a secure location. The License object contains the following properties:

{
    "licenseId": 123,
    "activatedOn": "2024-06-19T13:16:49.3418794Z",
    "ipAddress": "IP ADDRESS",
    "macAddress": "MAC ADDRESS",
    "machineId": "MACHINE ID",
    "licenseKey": "LICENSE KEY"
}

In order to validate a license, use the following method:

Tenant.Licensing.ValidatesAsync("Your License Key")

ex:
  var response = await Tenant.Licensing.ValidatesAsync("Your License Key");
  • licenseKey - The license key to validate.

This method will connect to the API endpoint and validate a license key. The method returns a License object.

{
    "licenseId": 123,
    "licenseKey": "LICENSE KEY",
    "isValid": true,
    "inTrial": true,
    "daysLeft": 29,
    "isPurchased": false
}

Once the trial is over, the isPurchased property will be set to true and the daysLeft property will be set to 0, if the users purchases the license. Otherwise, the application will be locked and the isValid property will be set to false.

Notice

You must implement whatever logic in your application to block its use after the trial is over and no license is purchased.

Known issues

When using nopCommerce, make sure to include the nuget dependency in the build

    ...
    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
    ...
     <Target Name="FilterCopyLocalItems" AfterTargets="ResolveLockFileCopyLocalProjectDeps">
        <ItemGroup>
          <ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" Condition="'%(Filename)' != 'SplatDev.Licensing.Tenant'" />
        </ItemGroup>
      </Target>
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net7.0

    • No dependencies.

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.1.14 109 7/16/2024
1.1.13 94 6/19/2024
1.1.12 86 6/19/2024
1.1.11 118 6/16/2024