SDK Overview
Install the license SDK, initialize the client, and understand the four calls you'll use.
The @theplugins/license-sdk client wraps the portal's Public API
so your plugin can validate licenses and report usage with a few typed calls.
Install
Framework-agnostic ESM, zero required dependencies. Runs in Node servers, serverless/edge functions, and WordPress sidecars.
Initialize
Store apiUrl in an environment variable so the same build can point at
staging or production.
The four calls
Almost every integration uses just these:
| Call | When | Page |
|---|---|---|
activate() | Once, on first run per install | Activation |
validate() | On startup / periodically | Validation |
reportUsage() | After each metered operation | Metered Usage |
entitlements() | Anytime you need limits/usage | Validation |
Result shape
Every call returns a discriminated Result — check ok before reading data:
This means you never have to wrap calls in try/catch for expected failures
(invalid key, limit reached) — those come back as ok: false.