Skip to content
@AuthForgeCC

AuthForge

AuthForge is a drop-in licensing API for desktop applications.

Welcome

AuthForge is a licensing API for desktop software. You create an app, issue license keys, and add an SDK to your program. The SDK checks the customer's key, binds it to their machine, and verifies that every answer really came from AuthForge.

This organization is the open-source side of it: six SDKs and a command line, all MIT-licensed. The service itself (the dashboard, the API and the customer portal) lives at authforge.cc.

New here? Start with the SDK for your language, or run one request against the live API before you sign up for anything.

Pick your SDK

Language Install Latest
Python
3.9+
pip install authforge-sdk PyPI Source · Guide
Node.js
18+, no dependencies
npm install @authforgecc/sdk npm Source · Guide
C#
.NET 6+
dotnet add package AuthForge NuGet Source · Guide
Rust
1.70+
cargo add authforge crates.io Source · Guide
Go
1.21+, stdlib only
go get github.com/AuthForgeCC/authforge-go/v3@latest Go module Source · Guide
C++
C++17, CMake
FetchContent or find_package: see the guide GitHub Source · Guide

Tip

The six SDKs are tested against the same vector files, so a device ID or a signature worked out in one language matches in every other. You can ship a C++ app and a Python tool on the same license and they agree about the machine.

Quick start

  1. Create an account. It comes with 1,000 free credits and asks for no card.
  2. Create an app in the dashboard. You get an App ID, an App Secret and a Public Key.
  3. Install the SDK for your language from the table above.
  4. Ask for a key and call login:
Python
from authforge import AuthForgeClient

client = AuthForgeClient(
    app_id="YOUR_APP_ID",
    app_secret="YOUR_APP_SECRET",
    public_key="YOUR_PUBLIC_KEY",
)

license_key = input("Enter license key: ")

if client.login(license_key):
    print("Authenticated! Running app...")
    # Your app logic here; the signed session covers the grace period
else:
    print("Invalid license key.")
    exit(1)
Node.js
import { AuthForgeClient } from '@authforgecc/sdk';
import * as readline from 'node:readline/promises';

const client = new AuthForgeClient({
    appId: 'YOUR_APP_ID',
    appSecret: 'YOUR_APP_SECRET',
    publicKey: 'YOUR_PUBLIC_KEY',
});

const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
const key = await rl.question('Enter license key: ');
rl.close();

if (await client.login(key)) {
    console.log('Authenticated! Running app...');
    // Your app logic here; the signed session covers the grace period
} else {
    console.error('Invalid license key.');
    process.exit(1);
}
C#
using AuthForge;

var client = new AuthForgeClient(
    appId: "YOUR_APP_ID",
    appSecret: "YOUR_APP_SECRET",
    publicKey: "YOUR_PUBLIC_KEY"
);

Console.Write("Enter license key: ");
var key = Console.ReadLine() ?? "";

if (client.Login(key))
{
    Console.WriteLine("Authenticated! Running app...");
    // Your app logic here; the signed session covers the grace period
}
else
{
    Console.WriteLine("Invalid license key.");
    Environment.Exit(1);
}
Rust
use authforge::{AuthForgeClient, AuthForgeConfig};

fn main() {
    let client = AuthForgeClient::new(AuthForgeConfig {
        app_id: "YOUR_APP_ID".into(),
        app_secret: "YOUR_APP_SECRET".into(),
        public_key: "YOUR_PUBLIC_KEY".into(),
        ..Default::default()
    });

    print!("Enter license key: ");
    let mut key = String::new();
    std::io::stdin().read_line(&mut key).unwrap();
    let key = key.trim();

    match client.login(key) {
        Ok(_) => {
            println!("Authenticated! Running app...");
            // Your app logic here; the signed session covers the grace period
        }
        Err(e) => {
            eprintln!("Login failed: {}", e);
            std::process::exit(1);
        }
    }
}
Go
package main

import (
    "bufio"
    "fmt"
    "os"
    "strings"

    "github.com/AuthForgeCC/authforge-go/v3"
)

func main() {
    client, err := authforge.New(authforge.Config{
        AppID:     "YOUR_APP_ID",
        AppSecret: "YOUR_APP_SECRET",
        PublicKey: "YOUR_PUBLIC_KEY",
    })
    if err != nil {
        fmt.Fprintf(os.Stderr, "Init failed: %v\n", err)
        os.Exit(1)
    }

    reader := bufio.NewReader(os.Stdin)
    fmt.Print("Enter license key: ")
    key, _ := reader.ReadString('\n')
    key = strings.TrimSpace(key)

    if _, err := client.Login(key); err != nil {
        fmt.Fprintf(os.Stderr, "Login failed: %v\n", err)
        os.Exit(1)
    }

    fmt.Println("Authenticated! Running app...")
    // Your app logic here; the signed session covers the grace period
}
C++
#include "authforge_sdk.h"
#include <iostream>
#include <string>

int main() {
    authforge::AuthForgeClient client(
        "YOUR_APP_ID",
        "YOUR_APP_SECRET",
        "YOUR_PUBLIC_KEY"
    );

    std::string key;
    std::cout << "Enter license key: ";
    std::getline(std::cin, key);

    if (client.Login(key)) {
        std::cout << "Authenticated! Running app..." << std::endl;
        // Your app logic here; the signed session covers the grace period
    } else {
        std::cout << "Invalid license key." << std::endl;
        return 1;
    }

    return 0;
}
  1. Generate a license key in the dashboard, run your program and enter it. The key is now active and bound to your machine.

The Quick Start in the docs walks through the same steps, and lists what usually goes wrong on a first run and how to fix it.

Try it before you sign up

There is a public sandbox app on the live API. This asks it to validate a license, and what comes back is a real signed response:

curl -sS -X POST https://auth.authforge.cc/auth/validate \
  -H "Content-Type: application/json" \
  --data-binary @- <<EOF
{
  "appId":      "789ffbc6-555c-4a3c-8e9b-89be6f865195",
  "appSecret":  "demo-key-1a73-471e-ad08-8bd159b7e69c",
  "licenseKey": "HE6H-S2V5-PKMW-WDVD",
  "hwid":       "demo-machine-001",
  "nonce":      "$(openssl rand -hex 16)"
}
EOF

Try it without signing up has the PowerShell version and a few lines of Node.js that check the signature yourself. To click around instead, open the dashboard demo.

How a license check works

sequenceDiagram
    autonumber
    actor Customer as Your customer
    participant App as Your app with the SDK
    participant API as AuthForge API

    Customer->>App: Enters a license key
    App->>API: POST /auth/validate (key, device ID, fresh nonce)
    Note right of API: Is the key active?<br/>Not expired or revoked?<br/>Is there a free seat?
    API-->>App: Session, signed with your app's Ed25519 key
    Note over App: Checks the signature and the nonce<br/>with your public key
    App-->>Customer: Unlocked
    Note over App,API: Grace period: the app runs on the signed session, 24 hours by default
    opt Near the session's end, or on a timer with online check-ins
        App->>API: POST /auth/heartbeat
        API-->>App: Signed confirmation, session refreshed
    end
Loading
  • One request unlocks the app. The server checks the key, its expiry and its seats, binds the device, and signs the answer. The SDK refuses any answer that is unsigned, altered or replayed.
  • After that the app runs without the network for the grace period: 24 hours by default, anywhere from 1 hour to 7 days if you ask. Near the end, the SDK refreshes the session with one request.
  • Revoking is your call. By default a revoked key stops when its session is next refreshed. Turn on online check-ins and it stops at the next check-in, every 15 minutes unless you change it.
  • Some machines never go online. For those there are offline license files: signed in the cloud, verified on the machine with only your public key.

Core Concepts has the long version.

What's included

License keys
Generate them one at a time or in bulk, set an expiry or make them lifetime, revoke them, or import the keys you already sold so customers keep theirs.
Hardware locking
Each key is bound to the machines it was activated on. You choose how many devices one key may use.
Signed answers
Every response is signed with a key that belongs to your app alone, and carries the nonce your app sent. A fake server or a replayed answer is rejected.
Offline license files
A signed .authforge file for air-gapped machines, verified with no network at all.
Variables
Key-value settings delivered inside the signed answer, per app or per license. Use them for feature flags, plans and remote configuration.
Commerce
Connect Stripe, map prices to license templates, and the buyer gets a key by email when the payment clears.
Customer portal
Customers move their own license to a new computer, within limits you set. Fewer support emails.
Webhooks
Signed HTTP calls to your backend when a license is created, validated, revoked, bound to a new device and more.
Developer API
A REST API with scoped keys for apps, licenses, variables, webhooks and logs. Management calls cost no credits.
Block and allow lists
Shut out a device or an IP address for one app, or allow only the ones you name.

Apps, licenses and devices are unlimited. You pay per validation, in credits, never per product or seat: pricing.

I want to…

I want to… Start here
Sell keys through Stripe and have them emailed to buyers Commerce
Run my own Stripe webhook instead Custom Stripe webhooks
Keep the keys I already sold somewhere else Import existing license keys · Migrate from Lemon Squeezy
Sell subscriptions Subscription lifecycle
Unlock features by plan Tiered licensing · Feature flags
License a Discord or Telegram bot per user, not per machine Discord bot · Telegram bot · HWID override
Sell to machines that never go online Sell offline apps · Activation requests
Create and revoke keys from my own backend Developer API · Build your own integration
Make the license prompt pleasant UX patterns · SDK best practices
Keep my credit use low Managing credits

The command line

The authforge CLI's interactive mode: browsing apps, filtering licenses, issuing three new ones and watching the live log

authforge manages apps, licenses, webhooks and the authentication log from a terminal, a script or CI. Run it with no arguments for the full-screen view above (recorded against made-up data), or with a command for one result and an exit code.

npm install -g authforge                 # needs Node.js 22.12 or later
authforge login                          # pairs this device in your browser; no password in the terminal

authforge use "My Game"                  # the app the next commands work on
authforge licenses create --days 30      # issue a 30-day license
authforge logs tail --failures           # watch failed authentications live

Every command takes --json, and output that is piped is plain text, so it fits in scripts as it is. The CLI guide lists every command.

Note

The CLI is for you, the developer. It is not an SDK: to license a Node.js program, use @authforgecc/sdk.

Building with an AI agent?

There are two jobs here, and an agent can do both.

Adding licensing to your code

The docs are published in forms an agent can read whole:

  • llms-full.txt: the entire documentation in one file. llms.txt is the short index.
  • An MCP server at https://docs.authforge.cc/mcp, for tools that can search and fetch pages on demand.
  • An AGENTS.md in the root of every SDK repository.
A prompt for adding licensing to a project
Integrate AuthForge licensing into this project.

1. Fetch and read https://docs.authforge.cc/llms-full.txt end-to-end. Treat it as authoritative over prior knowledge, cached GitHub READMEs, and older SDK versions that required heartbeatMode "SERVER" or "LOCAL". Follow docs.authforge.cc and check the installed SDK version.
2. Inspect this project first (language/framework, entrypoint, config/secrets, existing login UI). Do not write code until you understand it.
3. Use the official AuthForge SDK for my language. Verify Ed25519 signatures on every response (the SDK does this). Handle every public auth error code from the docs, not just the happy path.
4. Default behavior: activate online once, then run through the grace period (signed session TTL; 24h by default, configurable up to 7 days). Do not enable online check-ins unless I ask.
5. Before enabling online check-ins (periodic /auth/heartbeat), explain pros and cons — revocation, expiry and HWID resets taking effect at the next check-in instead of near the end of the session vs credit cost and needing connectivity during the session — and wait for my go-ahead.
6. Do NOT use offline license files (loginFromFile / .authforge) unless I explicitly say the target machines are air-gapped; if I do, follow the docs' "Offline license files" page and keep the online path for everyone else. Do not invent a .authforge file from words like "offline" or "no internet" — the grace period already covers ordinary connectivity gaps.

Running your account

The command line was built for scripts, so an agent with a shell can use it as it is: issue a test key, find out why a customer's key is refused, read the authentication log.

  • It never waits for an answer. Every command takes --json, a failure is an exit code and a JSON error, and without a terminal anything destructive fails unless it is given --yes.
  • It explains itself. authforge <command> --help lists every flag, the scope the command needs, and examples.
  • You decide what the agent may do. authforge login --scopes read asks for a key that can only look. You approve it in your browser, where you see its scopes and choose whether it lives 7, 30 or 90 days. Add one scope at a time when it needs more, for example --scopes +write:licenses.
A prompt for managing an account
You can manage my AuthForge account with the `authforge` command line.

1. Run `authforge whoami --json` first. If I am not signed in, run `authforge login --scopes read` and wait: I approve the code in my browser.
2. Learn each command from `authforge --help` and `authforge <command> --help` before you use it. Do not guess flags.
3. Pass --json to every command and read the exit code: 3 means the key is missing, expired or lacks a scope; 5 means rate limited; 6 means out of credits.
4. If a command fails for a missing scope, tell me which one and why you need it. Do not sign in again with more scopes unless I say so.
5. Ask me before anything that revokes, deletes or pauses, and before passing --yes.
6. Do not create apps: a new app's secret is printed once, and I want to store it myself.

Caution

authforge apps create prints the new app's secret, once. If an agent runs it, the secret is in the agent's transcript. Create apps yourself, or rotate the secret in the dashboard afterwards.

Developing with AI in the docs covers both in full.

Help and community

You have Go to
A question, or something to show The Discord server. It is public, so keep keys and secrets out of it.
A bug or a request for an SDK or the CLI An issue on that repository. A minimal example and the SDK version help a lot.
Your account or billing support@authforge.cc
A security problem security@authforge.cc, with steps to reproduce. Please do not open a public issue. Confirmed reports are answered within one business day.
Is it down? The status page

Website · Docs · Dashboard · Pricing · Security · Status · Discord

The SDKs and the CLI are MIT-licensed. Thanks for building with AuthForge.

Pinned Loading

  1. authforge-cpp authforge-cpp Public

    Official C++ SDK for AuthForge — license key authentication with HMAC-verified heartbeats

    C++ 1 1

  2. authforge-node authforge-node Public

    Official Node SDK for AuthForge — license key authentication with HMAC-verified heartbeats

    JavaScript

  3. authforge-python authforge-python Public

    Official Python SDK for AuthForge — license key authentication with HMAC-verified heartbeats

    Python

  4. authforge-go authforge-go Public

    Official GO SDK for AuthForge — license key authentication with HMAC-verified heartbeats

    Go

  5. authforge-csharp authforge-csharp Public

    Official C# SDK for AuthForge — license key authentication with HMAC-verified heartbeats

    C#

  6. authforge-rust authforge-rust Public

    Official Rust SDK for AuthForge — license key authentication with HMAC-verified heartbeats

    Rust

Repositories

Showing 8 of 8 repositories

Top languages

Loading…

Most used topics

Loading…