NineAuthDocs
StableC++20 Native

C++ Native SDK

Ultra-low overhead native library engineered for game engines (Unreal Engine, DirectX), high-performance utility software, and tamper-resistant desktop binaries.

Core Architectural Differentiators

The NineAuth C++ SDK is purposefully designed with strict native software principles:

  • Result-Based Error Handling: No C++ exceptions. Functions return explicit nineauth::Result<T> types ensuring robust zero-cost error branching in memory-constrained environments.
  • Synchronous & Blocking by Design: Native startup loops and anti-cheat hooks require deterministic, blocking auth checks before main loop initialization.
  • Static Linking by Default: Compiled directly into your final binary with zero external dynamic DLL dependencies (eliminating DLL injection and hijacking vectors).

Complete Integration Example

main.cpp
#include <nineauth/nineauth.hpp>
#include <iostream>

int main() {
    // 1. Initialize synchronous client
    nineauth::Client client("app_pub_live_9f83a2...", "https://api.nineauth.xyz");

    // 2. Extract hardware fingerprint
    std::string hwid = nineauth::hardware::compute_hwid();

    // 3. Authenticate with Result<T> return type
    auto auth_res = client.auth().login("dev@example.com", "Password123!", hwid);
    if (!auth_res.is_ok()) {
        std::cerr << "Auth failed: " << auth_res.error().message << std::endl;
        return 1;
    }

    std::string token = auth_res.value().token;
    std::cout << "Authenticated! Token: " << token << std::endl;

    // 4. Validate session
    auto session_res = client.sessions().validate(token, hwid);
    if (session_res.is_ok() && session_res.value().valid) {
        std::cout << "Protected software running..." << std::endl;
    }

    return 0;
}

Related Links