Skip to Content
Integrate in your appOverview

Integrate in your app

Building an Electron app? Use the Electron SDK: it does everything on these pages for you, from validating keys and fingerprinting machines to offline tokens, renewals and clock tampering. Read these pages to understand what it does, or to integrate another kind of app.

Your application talks to LicenseManager with one request: it sends the license key the customer entered, an id of the device, and its own version. LicenseManager checks the license, registers the machine, and answers with a signed license token. Your application stores the token and checks it locally on every launch, so it keeps working offline, and asks for a new one before it expires.

For Acme Photo, it’s what happens when a photographer pastes their key in Preferences → License: the app validates it, unlocks itself, and from then on starts without asking anything, even on a plane. Once a week, when it’s online, it validates the key again in the background.

What you need

  • The product’s id, like x7Kp2QaZ, from the product’s Dashboard or the Security page.
  • Your organization’s public key, from the Security page, to verify tokens. It isn’t a secret: embed it in your application’s code.
  • No API key. Validating a key needs no authentication, so your application never holds a secret.

Never ship an API key in your application: anyone could extract it and create licenses. API keys belong on your servers.

The steps

  1. Validate the license key when the customer enters it, and store the token you get back.
  2. Compute a machine fingerprint that identifies the device, and stays the same across launches.
  3. Verify the token offline on each launch, and validate the key again before it expires.
  4. Handle the errors: an expired license, a version the license doesn’t include, a license used on too many machines.

Before you start

Build your integration against a test product: its keys start with TEST-, and nothing you do there touches your real customers. Point your development builds at the test product’s id, and your release builds at the live one.