PermitPlane Docs
All docs pages

Floating licences

Let a customer run your app on any number of devices, but only so many at the same time.

PermitPlane counts the seats in the cloud. Your customer installs and hosts nothing.

1. You: give the licence its seats

  1. Import the licence with a concurrent_seats column (CSV), or import Cryptlex floating licences.
  2. Set concurrent_seats from 1 to 1000.
  3. Set the installation limit separately, up to 10,000. Many machines can be activated, but only the seat count runs at once.

2. You: set the seat rules in the policy

Policy fieldMeaningValues
lease_ttl_secondsHow long one seat lasts before renewal300 to 3600, default 900 (15 minutes)
max_borrow_hoursLongest offline borrow0 to 504, default 0 (off)

3. Your developer: take, renew and return seats in the app

  1. Take a seat when the app starts. Activation takes the seat in the same call. With no free seat, activation fails and nothing is created.
  2. Renew the seat about every half of lease_ttl_seconds. Repeating the checkout call, or refreshing, also extends an online seat by one TTL.
  3. Return the seat when the app closes. After a crash, the seat frees itself when its time runs out.

The signed licence data carries a lease claim and never outlives the seat.

TypeScript

Use @permitplane/client 0.2.0 or newer.

TypeScript
await client.checkoutSeat();   // or { borrowHours: 48 }
client.seatInfo();             // { kind, expiresAt } or null
await client.renewSeat();      // the heartbeat renews online seats
await client.releaseSeat();
  • With background refresh on, the client renews an online seat at about half the remaining time. It adds up to 10% jitter.
  • checkoutSeat throws SeatsExhaustedError with retryAfter when no seat is free.
  • It throws LeaseRequiredError after lease_required.
  • Both set status to 'seat_unavailable'.
  • dispose() returns an online seat and keeps a borrowed one.

C and C++

Use permitplane.h.

C
/* 0 = online seat, 1..504 = borrow in hours */
pp_client_checkout_seat(c, 0);
/* call heartbeat_in_seconds after reading the status */
pp_client_renew_seat(c);
pp_client_release_seat(c);
  1. Call pp_client_renew_seat from your own timer. Arm it with heartbeat_in_seconds from the client status, and read the status again after each call.
  2. On PP_ERR_API, read the server code and retry_after from pp_client_last_error.
  3. In C++, use checkout_seat, renew_seat and release_seat.

Go, Java, Kotlin, PHP and Rust

Call the renew method from your own timer, at about half the seat time.

ClientTake, renew, return
GoCheckoutSeat(ctx, hours), RenewSeat(ctx), ReleaseSeat(ctx)
Java and KotlincheckoutSeat(hours), renewSeat(), releaseSeat()
PHPcheckoutSeat($hours), renewSeat(), releaseSeat()
Rustcheckout_seat(hours), renew_seat(), release_seat()

Pass 0 for an online seat (PHP: null, Rust: None). Pass 1 to 504 hours to borrow.

Setup: TypeScript, Go, Java, PHP, Rust and C and C++ quickstarts.

C# and .NET

The client renews an online seat for you. Call CheckoutSeatAsync() to take one and ReleaseSeatAsync() to return it. Pass borrowHours: 1 to 504 to borrow. Setup: C# and .NET quickstart.

Without an SDK

  1. Take or renew a seat with POST /api/v1/activations/{id}/lease.
  2. Return it with DELETE on the same path.
  3. Read the usual refresh fields plus lease: { id, kind, expires_at }. kind is online or borrow.

4. Your customer: work offline with a borrowed seat

  1. Take the seat with borrow_hours, a whole number from 1 to 504.
  2. Stay within the policy's max_borrow_hours. Asking for more is refused with 422 validation_failed.
RuleDetail
Latest endThe licence's offline limit (paid_offline_days, 21 at most) or the end of paid coverage
Seat useCounts against the seat limit until it expires
Early returnReleasing or re-taking fails with lease_borrowed
Releasing the deviceLeaves a live borrow in place until it expires
Freeing it earlyOnly you, through the management API

Offline licence files and request files are for licences locked to devices. For a floating licence they answer not_floating. See Unattended and offline activation.

5. Your developer: handle seat errors

All are 409.

CodeWhenWhat to do
seats_exhaustedEvery seat is in use.Wait for Retry-After (1 to 3600 seconds). details has seats_limit, seats_in_use and next_expiry.
lease_requiredA refresh with no live seat.Take a seat first.
lease_borrowedReleasing or checking out online during a borrow.Wait for the borrow to expire, or ask the vendor to release it.
not_floatingA seat call on a licence that is not floating.Use normal activation and refresh.

6. You: watch and free seats

  1. Log in at app.permitplane.com and open the licence page (app.permitplane.com/ops/vendor/licenses/…).
  2. Read Floating seats for seats in use. Each installation shows its seat.
  3. To free a stuck online seat, open Recover this installation. Click Release installation. A live borrow stays until it expires.

With the management API:

OperationPermissionPurpose
List the seats of a licencelicenses.readReturns kind, state (active, released, expired), created_at, expires_at and released_at.
Release a seatdevices.releaseFrees a stuck seat, including a borrow. Needs a reason and an Idempotency-Key. The installation keeps its activation and checks out again.

Releasing a seat on a licence that is not floating answers not_floating. Paths and schemas are in the API reference.

7. You: track seat use

The metrics guide (for signed-in users) and the Prometheus export have three gauges. Each is per product and policy version.

GaugeCounts
leases_activeLive seats on active floating licences
leases_limitConcurrent seats summed over active floating licences
leases_borrowedLive seats of kind borrow