Go SDK
Drop-in source files for Go — copy them into your project. Nothing to install from a package registry.
Download
Standard library only (Go 1.22+).
client, err := licenseclient.New(
"https://license.foliox.sbs",
"YOUR_PRODUCT_ID", // shown on the product's page in your dashboard
"PASTE_PUBLIC_KEY_FROM_THE_DOCS", // public - not a secret
)
if err != nil {
log.Fatal(err) // unsafe or malformed configuration is reported here, before anything is sent
}
result := client.Check(licenseKey)
if result.Valid {
fmt.Println("licensed, status:", result.Status, "expires:", result.ExpiresAt)
} else {
fmt.Println("not licensed:", result.Reason)
}
Copy the licenseclient package into your own module (adjust the import path), or run go run ./example <key> here.
Options are functions passed to New: WithCachePath, WithTimeout, WithRetries, WithBackoff, WithDeadline, WithMaxResponseAge, WithHWID, WithInsecureLoopback, WithUserAgent. Also Verify (never activates), ClearCache, IsValidKeyFormat, ComputeHWID.
What it does for you
- HTTPS only (plain
http://is refused except for localhost while developing); certificates always verified, TLS 1.2+, redirects never followed. - Nothing is believed before its Ed25519 signature is checked, then the product it names and its age (
max response age, default 15 minutes) so an old captured answer can't be replayed. - Safe retries: network errors, timeouts, HTTP 429 and 5xx are retried with exponential backoff + jitter inside a hard deadline (default 20 s). A definite answer (revoked, expired, wrong device) is never retried or softened.
- Offline grace from the last valid signed answer (72 h, never past the key's own expiry), bound to this device, product and key; the raw key is never stored; a definite "no" deletes it; a clock set back is detected.
check()never raises/panics for runtime conditions - it returns a result. Bad configuration is reported when the client is created.
Offline grace is a resilience feature, not a security boundary. See the SDKs & API wrapper page in your server's docs for the full list, what no client library can do, and upgrade notes from v1.