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@v1.1.0
import permitcore "github.com/permitCore-spec/permitcore-sdk-go"
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 the sale. Your customer checks out in your branded Store and receives a working license automatically.
- 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.
go get github.com/permitCore-spec/permitcore-sdk-go@v1.1.0- Pin the v1.1.0 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
Run the compiled binary with a valid test key, a revoked key, and a key issued for another product. If offline grace is enabled, disconnect after a successful response and confirm IsOffline is true.
- 04Sell
Publish the product in your Store
Connect your Stripe account, add the product to your branded PermitCore Store, and publish. Checkout creates the license and delivers it to the customer without a webhook project or a second commerce platform.
- Publish platform-specific downloads
- Add the binary to your Store
- Connect your own Stripe account
- Test automatic key delivery
One checkout completes the sale and delivers the license.
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.