VB.NET SDK
The C# SDK as a tiny library your VB.NET project references.
Install
curl -o Warden/WardenClient.cs --create-dirs https://wardenauth.dev/packages/csharp/1.1.0/WardenClient.cs
curl -o Warden/Warden.csproj https://wardenauth.dev/packages/csharp/1.1.0/Warden.csproj
dotnet add reference Warden/Warden.csprojRun in your project folder (.NET 8+). VB.NET can't compile C# source, so the SDK is a tiny C# library your project references.
- Then
Imports Warden. - The API is the same as C#. Use
Awaitin anAsyncmethod, or.GetAwaiter().GetResult()fromSub Main.
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.
Imports Warden
Module Program
Sub Main()
Dim app As New WardenClient("YOUR_APP_ID",
"YOUR_PUBLIC_KEY",
"1.0", "https://wardenauth.dev/api/v1")
app.InitAsync().GetAwaiter().GetResult()
Console.Write("License key: ")
Dim user = app.LicenseAsync(Console.ReadLine()).GetAwaiter().GetResult()
Console.WriteLine("Welcome " & user.Username & "!")
End Sub
End ModuleExample 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
- Program.vb
- Run
- dotnet run
- Needs
- .NET 8+ (or open WardenExample.vbproj in Visual Studio)
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.
| Method | What 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; ex.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.