A professional, production-ready SDK for integrating with the KeyMint API in Go. Provides robust access to all major KeyMint features, with idiomatic Go error handling.
- Idiomatic Go: Clean, type-safe API using a
Clientstruct andkeymint.New()constructor. - Comprehensive: Complete API coverage for all KeyMint endpoints.
- Consistent error handling: All API errors are returned as
*ApiError. - Security: Credentials are always loaded from environment variables.
Add the SDK to your project:
go get github.com/keymint-dev/Keymint-Goimport (
"os"
"github.com/keymint-dev/Keymint-Go"
)
accessToken := os.Getenv("KEYMINT_ACCESS_TOKEN")
productId := os.Getenv("KEYMINT_PRODUCT_ID")
client, err := keymint.New(accessToken, "")
if err != nil {
// handle error
}
key, err := client.CreateKey(keymint.CreateKeyParams{ProductID: productId})
if err != nil {
// handle error
}All SDK methods return a result and an error. If the error is from the API, it will be of type *ApiError with Message, Code, and Status fields.
All methods return a result struct and an error.
| Method | Description |
|---|---|
CreateKey |
Creates a new license key. |
ActivateKey |
Activates a license key for a device. |
DeactivateKey |
Deactivates a device from a license key. |
GetKey |
Retrieves detailed information about a key. |
BlockKey |
Blocks a license key. |
UnblockKey |
Unblocks a previously blocked license key. |
| Method | Description |
|---|---|
CreateCustomer |
Creates a new customer. |
GetAllCustomers |
Retrieves all customers. |
GetCustomerById |
Gets a specific customer by ID. |
GetCustomerWithKeys |
Gets a customer along with their license keys. |
UpdateCustomer |
Updates customer information. |
ToggleCustomerStatus |
Toggles customer active status. |
DeleteCustomer |
Permanently deletes a customer and their keys. |
For detailed parameter and response types, see the KeyMint API docs or use your IDE's autocomplete.
MIT
For help, see KeyMint API docs or open an issue.