# Skull Labs Auth — C# SDK

Single-file C# SDK + a working WinForms example.

## Files

- `SkullLabsAuth.cs` — the SDK itself. Drop this into any C# project.
- `SkullLabsAuthExample/` — a complete .NET 6 WinForms project with two forms:
  - **Form1** — login (username + password + status label)
  - **Form2** — shows the logged-in user's username and validity-until

## Quick start

1. Get your **project key** from the Skull Labs Auth dashboard.
2. Open `SkullLabsAuthExample/Program.cs` and replace `slk_REPLACE_WITH_YOUR_PROJECT_KEY`.
3. Build and run:

   ```
   cd SkullLabsAuthExample
   dotnet run
   ```

## Using the SDK in your own project

Copy `SkullLabsAuth.cs` into your project and:

```csharp
using SkullLabs;

var auth = new AuthClient("slk_your_project_key");

// Username + password login
var session = await auth.LoginAsync("alice", "hunter2");
if (session.Ok)
{
    Console.WriteLine($"Welcome, {session.User.Username}");
    if (session.User.ExpiresAtUtc.HasValue)
        Console.WriteLine($"Valid until {session.User.ExpiresAtUtc.Value.ToLocalTime():u}");
}
else
{
    Console.WriteLine($"Login failed: {session.Error}");
}

// License-only login
var s2 = await auth.LoginWithLicenseAsync("SKL-XXXX-XXXX-XXXX-XXXX");
```

## HWID

The SDK auto-collects a stable hardware fingerprint (MAC + machine name → SHA-256). When HWID lock is enabled for a user or license in your dashboard, the SDK transparently sends it on every login.

## Support

Discord: https://dsc.gg/skulllabs · GitHub: https://github.com/skulllabsin
