EYMINT
DocumentationAPI Reference
BlogDashboard
EYMINT
SectionsDocumentationAPI Reference
Go to Dashboard

For AI agents: the documentation index is at /llms.txt. Every docs page is also available as markdown by adding .md to its URL.

Getting Started

  • Keymint Documentation
  • Introduction
  • Getting Started
  • License Keys
  • Changelog

SDK References

  • Software Development Kits (SDKs)
  • Node.js SDK
  • Go SDK
  • Python SDK
  • C# SDK

Integration Guides

  • Integration Guides
  • Customer Portal for Vendors
  • Roles & Permissions
  • Radar Alert Destinations
  • Payment Provider Integrations
  • Stripe Subscription Licensing
  • Import Existing License Keys
  • Email Delivery
  • API Key Management
  • Webhook Deliveries
  • Analytics and Retention
  • Dashboard Workflows
  • Electron Licensing
  • PyQt Licensing
  • Tauri Licensing
  • Next.js SaaS Licensing

Licensing Guides

  • Licensing Concepts
  • Node-Locking & Machine Identifiers
  • Floating Licenses
  • Offline Verification
  • License Radar
  • Public Key Management and Rotation
  • Feature Flags
  • Webhooks & Events

Templates

  • Starter Templates
  • Electron License Starter
  • PyQt License Starter
  • Tauri License Starter
  • Next.js SaaS License Starter

Security & Trust

  • Security & Trust

Support

  • Frequently Asked Questions
  • Customer Portal
  • Using the Customer Portal
  • Workspace Settings and Roles

Legal

  • Privacy Policy
  • Subprocessors
  • Data Processing Agreement
  • Security Overview
  • Terms of Service
  • Service Level Agreement (SLA)
  • GDPR Compliance

Floating Licenses

Enable concurrency-limited, real-time license leasing for distributed systems, desktop applications, and CLI tools.

Floating licensing allocates a dynamic pool of seats to a customer. Devices check out seats from Keymint, extend them via heartbeats, and release them upon application shutdown.

Core Mechanics

  1. Checkout: The application sends a POST /key/checkout request to lease a seat. The API returns a unique sessionId.
  2. Heartbeat: The application sends a POST /key/heartbeat periodically to extend the lease.
  3. Expiry: If a client crashes, the heartbeat stops. Keymint automatically reclaims the seat after the lease duration expires.
  4. Checkin: When the application exits normally, it calls POST /key/checkin to release the seat.

Configuration Parameters

ParameterDefaultAllowedDescription
Heartbeat Interval (heartbeatInterval)60s60–86,400 secondsHow often the application should send heartbeats. Returned by checkout as heartbeatInterval.
Lease Duration (sessionLeaseDuration)300s300–31,536,000 secondsHow long a seat stays held after a checkout or heartbeat before it is reclaimed.
Max Concurrent Sessions (maxConcurrentSessions)—1–1,000,000The seat pool size.
Grace Period15sFixedServer-side tolerance after a lease expires before the seat is reclaimed.

Set the heartbeat interval well below the lease duration so one missed heartbeat doesn't lose the seat.

Integration Workflow

mermaid
Rendering diagram...

Session Extension (Re-Checkout)

The first POST /key/checkout for a hostId creates a new session and requires no signature. Re-checking out a hostId that still has an active session is treated as a session extension and requires proof that the caller possesses the session secret:

FieldValue
timestampThe session's current nextNonce (from the last checkout/heartbeat response)
signatureHMAC-SHA256(sessionSecret, "${sessionId}:${timestamp}")

This is the same challenge-response scheme as heartbeat and checkin. It prevents a device behind a shared NAT from rotating another device's nonce and taking over its session. An unsigned or invalid extension is rejected with 401.

typescript
// Extending an ACTIVE session (e.g. app restarted before the lease expired)
const signature = KeyMint.generateSessionSignature(
  session.sessionId,   // from the original checkout response
  session.nextNonce,   // the CURRENT nonce — rotate after every response
  session.sessionSecret
);

const extended = await keymint.floatingCheckout({
  productId,
  licenseKey,
  hostId,
  timestamp: session.nextNonce,
  signature
});

// The response rotates the nonce; the session secret stays the same until a
// new session starts. Store what comes back for the next call.
session.nextNonce = extended.nextNonce;
session.sessionSecret = extended.sessionSecret;

If the previous lease has already expired (past the 15-second grace period), checkout behaves like a fresh checkout (no signature required). Only active-session extensions enforce proof of possession.

Session Rules and Errors

  • Proof of possession, not IP binding. Sessions are not bound to an IP address, so clients behind changing or shared networks keep working; the nonce chain and sessionSecret are what tie a session to its device.
  • No Idempotency-Key. Checkout, heartbeat and checkin ignore the Idempotency-Key header. Each response rotates the nonce, so always use the nextNonce from the latest response.
  • Errors. A full pool returns 403 with errorCode: "floating_seats_full" (code: 4, with currentSessions and maxSessions). A wrong signature or stale nonce on heartbeat or checkin returns 401 session_invalid. A session that expired or was checked in or revoked returns 410 session_expired (code: 5): check out again. See Error Codes.
  • Lapsed vendor subscription. If your Keymint subscription lapses with usage over the Free limits, existing sessions keep working during the 30-day continuity period but new sessions get 402; after it, checkout and heartbeat return 402.

Session Management

You can monitor and manage active floating sessions in the Keymint dashboard:

  • Active sessions: Open a license's activations to see its active floating sessions.
  • Force revoke: End a session to free its seat for another device if a client crashes or fails to check in. The device finds out on its next heartbeat.

Integration Code Examples

Below is a complete implementation pattern showing how to lease, extend, and release floating license seats using the Keymint SDKs.

import { KeyMint } from 'keymint';

const keymint = new KeyMint('YOUR_API_KEY');
const productId = 'YOUR_PRODUCT_ID';
const licenseKey = 'A8E2K-9F1BC-3D4GH-7J2KM';

// 1. Resolve a stable host identifier for this device
const hostId = KeyMint.getOrCreateInstallationId();

async function manageFloatingLicense() {
  try {
    // 2. Checkout a seat session
    const session = await keymint.floatingCheckout({
      productId,
      licenseKey,
      hostId
    });

    console.log(`License leased. Session ID: ${session.sessionId}`);
    let currentNonce = session.nextNonce;

    // 3. Set up a periodic heartbeat loop based on the returned interval
    const heartbeatIntervalMs = session.heartbeatInterval * 1000;
    const intervalId = setInterval(async () => {
      try {
        // Generate the HMAC signature using the rotating nonce
        const signature = KeyMint.generateSessionSignature(
          session.sessionId,
          currentNonce,
          session.sessionSecret
        );

        const heartbeatRes = await keymint.floatingHeartbeat({
          productId,
          licenseKey,
          sessionId: session.sessionId,
          timestamp: currentNonce,
          signature
        });

        // Rotate the nonce for the next heartbeat challenge
        currentNonce = heartbeatRes.nextNonce;
        console.log('Heartbeat extended successfully.');
      } catch (err) {
        console.error('Heartbeat failed:', err.message);
        // Implement backup retry/grace logic here (e.g. warn user or restrict features)
      }
    }, heartbeatIntervalMs);

    // 4. Register a clean shutdown hook to check in the seat
    process.on('SIGTERM', async () => {
      clearInterval(intervalId);
      try {
        const signature = KeyMint.generateSessionSignature(
          session.sessionId,
          currentNonce,
          session.sessionSecret
        );
        await keymint.floatingCheckin({
          productId,
          licenseKey,
          sessionId: session.sessionId,
          timestamp: currentNonce,
          signature
        });
        console.log('Session checked in. Seat released.');
        process.exit(0);
      } catch (err) {
        console.error('Graceful checkin failed:', err.message);
        process.exit(1);
      }
    });

  } catch (error) {
    console.error('Checkout failed (no available seats or invalid license):', error.message);
  }
}

manageFloatingLicense();

On this page

  • Core Mechanics
  • Configuration Parameters
  • Integration Workflow
  • Session Extension (Re-Checkout)
  • Session Rules and Errors
  • Session Management
  • Integration Code Examples