Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Authon Go SDK

Authon
Official Go SDK for Authon — Software Licensing & Authentication Platform

WebsiteDocsDiscordStatus


Installation

go get github.com/authonpro/sdk-go

Or copy authon.go into your project.

Requirements

  • Go 1.21+
  • No external dependencies (stdlib only)

Quick Start

package main

import (
    "fmt"
    authon "github.com/authonpro/sdk-go"
)

func main() {
    auth := authon.New("your-app-id", "your-api-key")

    ok, _ := auth.Init()
    if !ok {
        fmt.Println("Connection failed")
        return
    }

    result, _ := auth.Login("username", "password")
    if result.Success {
        fmt.Printf("Level: %d\n", auth.Level)
        fmt.Printf("Expires: %s\n", auth.ExpiresAt)
    } else {
        fmt.Printf("Error: %s\n", result.Message)
    }

    auth.Logout()
}

Authentication

// Login
result, _ := auth.Login("user", "pass")

// License key
result, _ := auth.License("XXXXX-XXXXX-XXXXX-XXXXX")

// Register
result, _ := auth.Register("newuser", "pass", "LICENSE-KEY")

// Custom HWID
result, _ := auth.Login("user", "pass", "custom-hwid")

Features

// Variables
val, _ := auth.GetVar("key")
auth.SetVar("key", "value")
uvar, _ := auth.GetUserVar("key")

// File download
data, _ := auth.DownloadFile("file-id")
os.WriteFile("output.exe", data, 0644)

// Stats
auth.FetchOnline()
auth.FetchStats()

// Logging
auth.Log("User action")

// Session
valid, _ := auth.Check()
auth.Logout()

Run Example

cd example
go run main.go

Links

License

MIT

About

Authon Go SDK - Authentication, licensing & file download for Go applications

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages