Skip to Content
TauriOverview

Tauri SDK

tauri-plugin-licensemanager does the whole integration for a Tauri v2 app: it validates the key the customer enters, computes a stable machine fingerprint, stores the key and the license token in the system keychain, verifies the token offline, renews it in the background, and tells your app, at any time, in one state, whether it should unlock.

It comes in two parts, released together with the same version: the plugin crate, which does the work in Rust, and @licenseman/tauri, typed functions for your webview.

src-tauri/src/lib.rs
tauri::Builder::default() .plugin( tauri_plugin_licensemanager::Builder::new( "x7Kp2QaZ", "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA…\n-----END PUBLIC KEY-----", ) .build(), )
src/main.ts
import { watchLicense } from "@licenseman/tauri"; // Called with the current license, then on every change: // "ACTIVE", "MISSING_KEY", "EXPIRED"… await watchLicense(({ state }) => render(state));
Activation window of a desktop app, with a license key field and an Activate button

What the SDK does

Validates on every launchWhen online, the stored key is validated again on each launch, so an expired license or a deactivated machine is noticed right away. With a valid stored token, it runs in the background, without delaying startup. See validation and renewal.
Works offlineWhen LicenseManager can’t be reached, the app keeps running on the stored token until it expires. See working offline.
Renews in the backgroundThe key is validated again before the token expires. Transient failures are retried, and while offline, the SDK keeps trying with a backoff.
Locks only when it shouldOnly the four errors that say something about the license lock the app. A network error, a 500 or a 402 never do.
Detects clock tamperingA clock set back to keep using an expired token is detected while offline. See clock tampering.
Fingerprints the machineFrom the system’s machine id and a random id stored in the keychain, specific to your product. See machine fingerprint.
Stores secrets safelyIn the macOS Keychain, the Windows Credential Manager or the Linux Secret Service, with a file fallback. See stored data.
Exposes only what’s neededYour windows get the state and the activation through Tauri permissions; the full key and the fingerprint stay in Rust unless you allow them. See frontend and permissions.
Compatible with the Electron SDKSame stored data, same fingerprint: an app moving from Electron to Tauri keeps its activations. See migrating from Electron. A native Mac app can use the macOS SDK, compatible too.

Requirements

  • Tauri 2 and Rust 1.90 or later.
  • Desktop only: macOS, Windows and Linux. On iOS and Android, the plugin fails the app’s setup.
  • Your product’s id and your organization’s public key, from the Security page. See what you need.

There’s no native Node module and no system package to install: the keychain access is compiled into your app.

How it works

The pages of this section

  1. Installation and setup: install the crate and the package, register the plugin, and every option.
  2. Activating a license: the activation screen, setLicenseKey and its errors.
  3. License states: what each state means and what your app should show.
  4. Validation and renewal: when the SDK validates, what it sends, and how to tune it.
  5. Working offline: the fallback on the stored token, retries and versions.
  6. Clock tampering: how a clock set back is detected.
  7. Machine fingerprint: how the device is identified, and how to override it.
  8. Stored data: what’s stored, where, and how to reset it.
  9. Frontend and permissions: what your windows can call, and how to render the license.
  10. Using it from Rust: gate your commands, and react to changes in Rust.
  11. Migrating from Electron: keep your customers’ activations.
  12. API reference: every function, command, permission and type.

Build your integration against a test product first: its keys start with TEST-, and nothing you do there touches your real customers. See development and release builds.