LuckyCodeIntegration 2.0.16
See the version list below for details.
dotnet add package LuckyCodeIntegration --version 2.0.16
NuGet\Install-Package LuckyCodeIntegration -Version 2.0.16
<PackageReference Include="LuckyCodeIntegration" Version="2.0.16" />
<PackageVersion Include="LuckyCodeIntegration" Version="2.0.16" />
<PackageReference Include="LuckyCodeIntegration" />
paket add LuckyCodeIntegration --version 2.0.16
#r "nuget: LuckyCodeIntegration, 2.0.16"
#:package LuckyCodeIntegration@2.0.16
#addin nuget:?package=LuckyCodeIntegration&version=2.0.16
#tool nuget:?package=LuckyCodeIntegration&version=2.0.16
🧩 LuckyCodeIntegration (.NET)
A modern, secure, and plug-and-play integration package for LuckyCode API
🚀 Overview
The LuckyCodeIntegration package provides an instant and secure way to integrate your .NET applications with the LuckyCode API.
It handles token authentication, API communication, and configuration automatically — allowing developers to focus on business logic instead of setup.
✨ Features
- 🔐 Built-in Authentication: Auto token retrieval & refresh via
EnsureValidToken() - ⚙️ Simple Configuration: Reads settings directly from
appsettings.json - 🧱 Dependency Injection Ready: Uses
IHttpClientFactoryandIOptions<T> - 🔄 Automatic Token Caching: Keeps connections secure and efficient
- 🧰 Full API Coverage: Supports Pull, Reveal, Redeem, Multi-Pull, and Check Serial Code
- 🧩 Prebuilt Controller: Optional
LuckyCodeControllerfor rapid testing
📦 Installation
Install via NuGet Package Manager or CLI:
dotnet add package LuckyCodeIntegration --version 2.0.13
⚙️ Configuration
appsettings.json
"LuckyCode": {
"BaseUrl": "https://api.redeemly.com",
"AccessCredential": {
"ApiKey": "your-api-key",
"ClientId": "your-client-id"
}
}
Program.cs
using LuckyCodeLibrary.IntegrationHelper.Extensions;
builder.Services.AddIntegrationService(
builder.Configuration.GetSection("LuckyCode").Bind);
🔑 Example Usage
using LuckyCodeLibrary.IntegrationHelper.Services;
using LuckyCodeLibrary.IntegrationHelper.Models;
public class Example
{
private readonly ILuckyCodeServices _luckyCodeServices;
public Example(ILuckyCodeServices luckyCodeServices)
{
_luckyCodeServices = luckyCodeServices;
}
public async Task RunAsync()
{
var token = await _luckyCodeServices.EnsureValidToken();
var request = new PullCodeRequest
{
CustomerRef = "CUST-12345",
Quantity = 1
};
var result = await _luckyCodeServices.PullCode(request, token);
if (result.Success)
Console.WriteLine($"Code Pulled: {result.Data.Code}");
else
Console.WriteLine($"Error: {result.Message}");
}
}
🧩 Available Endpoints
| Method | Endpoint | Description |
|---|---|---|
POST |
/lucky-code-adapter/pull |
Pulls a new code |
POST |
/lucky-code-adapter/reveal |
Reveals hidden code details |
POST |
/lucky-code-adapter/redeem |
Redeems a code |
POST |
/lucky-code-adapter/multi-pull |
Pulls multiple codes |
GET |
/lucky-code-adapter/check-serialcode |
Validates a serial code |
🧠 Internal Logic
- EnsureValidToken()
- Fetches a bearer token from LuckyCode API using API Key & Client ID.
- Caches it in memory and refreshes automatically before expiration.
✅ Client Integration Demo
A sample .NET project was built to simulate a real client using this package.
The demo successfully validated:
- Configuration binding
- Token management
- Secure API communication
- Fast setup (under 10 minutes)
📄 License
Licensed under the MIT License — free for commercial and private use.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net8.0
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.Extensions.Http (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.0)
- Newtonsoft.Json (>= 13.0.3)
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 |
|---|---|---|
| 2.0.33 | 114 | 2/16/2026 |
| 2.0.32 | 107 | 2/12/2026 |
| 2.0.31 | 107 | 2/5/2026 |
| 2.0.30 | 117 | 2/5/2026 |
| 2.0.29 | 112 | 2/5/2026 |
| 2.0.28 | 107 | 2/5/2026 |
| 2.0.27 | 112 | 2/5/2026 |
| 2.0.26 | 109 | 2/5/2026 |
| 2.0.25 | 116 | 2/4/2026 |
| 2.0.23 | 113 | 2/4/2026 |
| 2.0.22 | 117 | 2/4/2026 |
| 2.0.21 | 116 | 2/4/2026 |
| 2.0.20 | 115 | 2/4/2026 |
| 2.0.19 | 121 | 2/3/2026 |
| 2.0.18 | 117 | 2/3/2026 |
| 2.0.16 | 185 | 10/13/2025 |
| 2.0.14 | 188 | 10/13/2025 |
| 2.0.13 | 194 | 10/9/2025 |