Two keys, two jobs
A Tauri app that sells licenses ends up with two signing systems, and mixing them up is the most common stumble.
| Tauri updater key | Clavem product key | |
|---|---|---|
| What it signs | Your installers and update bundles | License tokens issued by Clavem |
| Who holds the private half | You | Clavem; you never see it |
| Where the public half goes | tauri.conf.json |
Your Rust code, to verify tokens |
| If it is lost | You cannot ship updates to installed apps | Nothing breaks; the public key is on your product page |
Tauri’s documentation is blunt about the first row: the updater needs a signature to verify that an update comes from a trusted source, and “this cannot be disabled”. If you lose the private key you cannot publish new updates to apps that are already installed. Back it up before your first sale, not after.
The second row is why license checks work offline: the token is verified with a public key that is in your binary. See offline verification.
Do the work in Rust
Tauri splits an app into a web view and a Rust core. Put the License API calls, the Ed25519 check and the storage in Rust, register them as commands and call them from the front end.
- Calls. A request from Rust with
reqwesthas no browser CORS rules and needs no permission. If you do call from the web view through Tauri’s HTTP plugin, its permissions need an allow list of URLs, for examplehttps://clavem.io/*, or the call is blocked. - Verification.
ed25519-dalekchecks the signature, and your code checkspid,valid,expandrefresh_by. The Tauri guide has the commands and the front-end calls. - Storage. The
keyringcrate writes to Keychain on macOS, Credential Manager on Windows and the secret service on Linux. - What the front end sees. A state such as
licensedorneeds-network, and an error message to show. Not the key, not the token.
A Rust binary is harder to read than a bundle of JavaScript, but it can still be patched. Treat the check as a way to keep honest customers honest.
Differences from Electron
Tauri uses the system’s web view: WKWebView on macOS, WebView2 on Windows and WebKitGTK on Linux. That makes the installer small and the web layer different on each system. It does not change licensing, because the check is in Rust. For a comparison with the Electron approach, where the check is in the Node main process, see Electron apps.
Updates
Clavem’s releases endpoint returns the newest published release as JSON, with a signed download link on each file when the key is valid. Tauri’s updater expects its own manifest and verifies its own signature. Reasonable combinations:
- Use Tauri’s updater for the update itself, hosting its manifest and bundles wherever you like, and use Clavem only for the key.
- Use Clavem’s endpoint to tell the user a version exists and gate the download page, and let them install it by hand.
- Run a small endpoint of your own that checks the license with Clavem and then answers in the updater’s format, so only licensed users get update links.
If you take the third route, remember that each Clavem download link lasts an hour.
Recommended setup
| Setting | Suggested value | Why |
|---|---|---|
| License type | Perpetual with paid major versions, or a subscription | Subscriptions fit apps with running costs; perpetual fits a finished tool |
| Device limit | 3 | Desktop, laptop and a replacement |
| Trial | 14 days | Enough to judge a small app |
| Updates | Tauri updater with its own key, or the releases endpoint | Pick one source of truth for versions |
Doing this with Clavem
Create a product, connect Stripe and map the Stripe product. Add the product’s public key and id to your Rust code. The activation call takes an instance_name and an optional fingerprint; use a stable device id such as the one the machine-uid crate provides, hash it, and send the hash. Activating again with the same fingerprint returns the same seat, so reinstalling is free for the customer.
Guides to follow
- License key validation in Tauri
- Device activation in Tauri
- Offline license verification in Rust
- Software updates in Tauri
Questions
Can I use Tauri's updater with Clavem?
You can use both, for different jobs. Clavem checks the license and can host and gate release files. Tauri's updater verifies its own signature on every update, which cannot be turned off, so your updates need a Tauri signing key whatever you do for licensing.
Should the front end call the License API directly?
It is better not to. Tauri's HTTP plugin needs an allowed-URL scope, and a request made from JavaScript puts the key in the web layer. A Rust command can make the call and return only licensed or not.