License keys are a native benefit type in Polar — ideal for desktop applications, paid CLIs, SDKs, and anything that needs an offline-checkable credential issued at purchase time. The package exposes three surfaces:Documentation Index
Fetch the complete documentation index at: https://danestvesllc-2b77d201.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
- Admin management — list, fetch, and update keys using your org-scoped access token.
- Public verification — validate, activate, and deactivate from end-user machines (no admin token required).
- Billable accessor — retrieve a customer’s keys from the
Billabletrait using a server-side session.
License keys are created automatically by Polar when a customer purchases a product that has the license key benefit attached. You don’t create them programmatically — you manage and validate them.
Configuration
The public verification methods —validateLicenseKey, activateLicenseKey, and deactivateLicenseKey — require a Polar organization ID. Set it once in your .env and the package will pick it up automatically on every call:
Admin management
Use theLaravelPolar facade with your org-scoped access token. These methods derive the organization from the token itself, so no extra configuration is needed.
getLicenseKey() returns a LicenseKeyWithActivations object, which includes the full list of current activations on the key.Public verification
These methods are designed to be called from end-user machines (a desktop app, a CLI, a native SDK). They do not require an org-scoped admin token; they resolve the organization ID frompolar.organization_id in your config (or from an explicit argument).
Validate a license key
Check whether a key is valid. Optionally bind the validation to a specific activation:Activate a key on a new device
Record a new activation against a key. Pass a human-readablelabel and optional meta properties:
Deactivate an activation
Remove an activation when a customer uninstalls or transfers their license:Explicit organization ID override
PassorganizationId as a named argument on any public verification call to override the config value: