How to license and sell a Go application
Install the tagged Go module, require a key issued for this exact product, validate a CLI or compiled binary, and publish it in a Store that delivers licenses automatically.
go get github.com/permitCore-spec/permitcore-sdk-go/v2@v2.1.1
import permitcore "github.com/permitCore-spec/permitcore-sdk-go/v2"
client := permitcore.New("https://api.permitcore.dev")
result := client.Validate(
licenseKey,
version,
productID,
)
if !result.IsValid {
log.Fatalf("License invalid: %s", result.Message)
}From product record to paid customer
Use PermitCore for the licensing layer and Store checkout. Verified paid evidence triggers the configured license issuance and queues the delivery email; test actual delivery before launch.
- 01Create
Create the product and license policy
In Products, create the software your key unlocks. Choose its activation limit, validity, offline grace period, version range, and feature flags.
- Create the CLI or binary product
- Set version and activation limits
- Choose optional offline grace
- Copy the product ID
- 02Implement
Install the Go SDK and scope the key
Put license activation in the first-run flow and validation at startup. Pass your product ID so a valid key for another product cannot unlock this one.
These are application fragments: supply your own key/product variables and UI or host flow. A validation call does not register a device or reserve a floating session. Check failure before protected work. Offline use needs explicitly configured trusted public keys; follow the SDK 2.1.1 offline setup. For C++, use the vcpkg registry and pinned baseline in its installation reference, rather than assuming a built-in public port.
go get github.com/permitCore-spec/permitcore-sdk-go/v2@v2.1.1- Pin the v2.1.1 module
- Read the key from a secure user config
- Validate with version and product ID
- Map feature flags to commands
- 03Verify
Test the real validation path
The shown fragment performs online validation. For SDK 2.1.1 offline grace, first configure trusted public keys, a private cache directory and a stable device ID as described below. Test valid, revoked, expired and wrong-product states, then disconnected behavior after a valid signed proof has been cached.
- 04Sell
Publish the product in your Store
Connect your chosen Stripe, Paddle or Lemon Squeezy account, add the product to your branded PermitCore Store, and publish. Account credentials, matching catalog prices and signed webhook configuration are required. PermitCore processes the verified payment and handles Store license fulfillment.
- Publish platform-specific downloads
- Add the binary to your Store
- Connect your chosen Store payment provider
- Test automatic key delivery
Verified payment triggers license issuance and the delivery email queue.
Go production checklist
The sample is intentionally small. Add these safeguards before making licensing part of a paid release.
- Do not compile an Admin API credential into the binary.
- Avoid passing the license key on the command line where shell history can capture it.
- Use stable machine identity only when device binding is part of the product promise.
- Test cross-compiled targets and offline-cache paths on their actual operating systems.