Tauri License Starter

Clone-and-run Tauri v2 app with Keymint license activation pre-configured in Rust. Machine binding, activation UI, and license state persistence included.

Quick Start

bash
git clone https://github.com/keymint-dev/keymint-tauri-starter.git
cd keymint-tauri-starter
npm install
# Edit src-tauri/.cargo/config.toml with your KEYMINT_CLIENT_API_KEY and KEYMINT_PRODUCT_ID
npm run tauri dev

Opens a Tauri window with an activation dialog. Enter a valid Keymint license key, and the main app unlocks.

What's Included

  • Rust license backendreqwest HTTP calls to Keymint API from Tauri commands
  • Hardware fingerprintmachine-uid crate for stable host ID across platforms
  • Activation UI — Clean Svelte/React dialog with key entry and status
  • Persistent state — License key and activation stored in app data directory
  • Deactivation — Frees activation seat on user request
  • Tauri commandsactivate_license, deactivate_license, is_activated, get_license_status

Configuration

Set environment variables before building:

bash
export KEYMINT_CLIENT_API_KEY=km_client_your_key
export KEYMINT_PRODUCT_ID=prod_Nx8K2mLpQ4rVtW9sBc

Or add to src-tauri/.cargo/config.toml:

toml
[env]
KEYMINT_CLIENT_API_KEY = "km_client_your_key"
KEYMINT_PRODUCT_ID = "prod_Nx8K2mLpQ4rVtW9sBc"
VariableWhere to Find It
KEYMINT_CLIENT_API_KEYKeymint Dashboard → Developer → API Keys (client scope)
KEYMINT_PRODUCT_IDKeymint Dashboard → Products

Project Structure

text
src-tauri/
├── src/
│   ├── main.rs        # Tauri app setup, command registration
│   └── license.rs     # Keymint REST API calls (reqwest), state persistence
├── Cargo.toml         # Rust dependencies
└── .cargo/
    └── config.toml    # Build-time env vars (API key, product ID)

src/                    # Webview frontend (Svelte/React/Vue)
├── lib/
│   └── Activation.svelte  # Activation UI component
└── App.svelte             # Main app (gated on license check)

API Endpoints Called from Rust

EndpointMethodPurpose
POST /key/activatereqwest::Client::post()Validate license and bind to machine
POST /key/deactivatereqwest::Client::post()Free activation seat

Tauri Commands

CommandReturnsPurpose
activate_license(key)Result<String, String>Activate with key, returns message
deactivate_license()Result<String, String>Deactivate, free seat
is_activated()boolCheck current activation state
get_license_status()JSONReturn masked key + status for UI

Security

  • KEYMINT_CLIENT_API_KEY is compiled into the Rust binary via option_env!() — not exposed to the webview
  • The client scope only allows activation, deactivation, and floating session management
  • License state is stored in the OS app data directory (dirs::data_local_dir())

Build & Package

bash
npm run tauri build

Produces platform-specific installers in src-tauri/target/release/bundle/.

Next Steps