Activation
Activate a license on an install and generate a stable fingerprint.
Activation ties a license key to one install (a device or site), identified
by a fingerprint. Do it once on first run, then persist the returned
connectionId.
Activate
Don't activate on every boot. Activate once, store the connectionId, and use
validate() thereafter. Re-activating repeatedly can
burn through the activation limit.
Generating a stable fingerprint
A fingerprint must be:
- Stable — identical across restarts of the same install
- Unique per install — different for each device/site/deployment
Pick a seed that fits your environment:
| Environment | Good fingerprint seed |
|---|---|
| WordPress | md5(get_site_url()) |
| Single server | hostname + primary MAC |
| Serverless/edge | A provisioned INSTANCE_ID env var |
| Vercel | process.env.VERCEL_DEPLOYMENT_ID |
Activation limits
A license caps how many installs can be active at once (maxActivations). When
the cap is reached, activate() returns an ACTIVATION_LIMIT error.
Deactivating an install
To free a slot, deactivate the install. The customer can do this from the portal Connections page, or your plugin can call it directly:
This hits POST /public/deactivate and frees one activation immediately.