All SDKs

WPF SDK

The C# package in a WPF or WinForms app.

v1.1.0.NET 8+ on Windows, or .NET Framework 4.7.2+

Install

terminal
dotnet nuget add source https://wardenauth.dev/packages/nuget/index.json -n warden
dotnet add package Warden.Client

Same package as C#. Works with WPF and WinForms on .NET 8+ or .NET Framework 4.7.2+.

  • Call the SDK from async void event handlers; the awaits resume on the UI thread, so you can update controls directly.

The URL includes the version, and released versions never change, so a pinned install keeps working. See the changelog for older versions.

Quickstart

Replace the placeholders with your app's values from its Overview in the dashboard, where the Add Warden to your project card shows this snippet with your credentials already filled in. The application ID and public key are safe to ship; never put your seller key in client code.

MainWindow.xaml.cs
using System.Windows;
using Warden;

public partial class MainWindow : Window
{
    private readonly WardenClient _app = new WardenClient(
        appId: "YOUR_APP_ID",
        publicKey: "YOUR_PUBLIC_KEY",
        version: "1.0",
        apiUrl: "https://wardenauth.dev/api/v1");

    public MainWindow() => InitializeComponent();

    private async void SignIn_Click(object sender, RoutedEventArgs e)
    {
        try
        {
            await _app.InitAsync();
            var user = await _app.LicenseAsync(KeyBox.Text);
            MessageBox.Show($"Welcome {user.Username}!");
        }
        catch (WardenException ex) { MessageBox.Show(ex.Message); }
    }
}

Example project

A complete program with the usual loader menu (login, register, upgrade, key-only login) that prints the user's details. It bundles the SDK, so it runs without installing anything. Fill in the Application credentials block and put your code where it says Your application code goes here.

Edit
MainWindow.xaml.cs
Run
dotnet run
Needs
.NET 8+ on Windows (or open the .csproj in Visual Studio)
Download the WPF example

API

Every method maps to one call of the client API. Each response is checked against your public key, timestamp and nonce before the SDK uses it.

MethodWhat it does
await app.InitAsync(…)Start a session. Call this first.
await app.LoginAsync(…)Log in with a username and password.
await app.RegisterAsync(…)Create an account by redeeming a license key.
await app.LicenseAsync(…)Log in with just a license key.
await app.UpgradeAsync(…)Redeem another key on an existing account.
await app.CheckAsync(…)Whether the session is still logged in.
await app.CheckBlacklistAsync(…)Whether this machine's IP or HWID is blacklisted.
await app.VarAsync(…)Read a global variable.
await app.GetVarAsync(…)Read one of the user's variables.
await app.SetVarAsync(…)Write one of the user's variables.
await app.FileAsync(…)Download a file into memory.
await app.WebhookAsync(…)Call one of your webhooks through the server.
await app.LogAsync(…)Send a log line to your dashboard.
await app.BanAsync(…)Ban the current user (e.g. after detecting a debugger).
await app.FetchOnlineAsync(…)Usernames with a logged-in session.
await app.FetchStatsAsync(…)User, online and key counts.
await app.ChatGetAsync(…)The last 50 messages in a channel.
await app.ChatSendAsync(…)Post to a channel.
await app.LogoutAsync(…)End the session.

Errors

Failures throw WardenException; e.Response holds the server's reply when it rejected the request.

Rejected responses, including a bad signature, a stale timestamp or a replayed nonce, fail the same way, so a spoofed server can't log anyone in. See verifying responses, and protecting your app for what a signature check can and can't stop.