You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**10 heartbeats = 1 credit** (billed on every 10th successful heartbeat per license).
14
-
-Any`heartbeat_interval`is safe — from `1` (server apps) to `900`(15 min, desktop apps). Revocations always take effect on the **next** heartbeat regardless of interval.
14
+
-Keep`heartbeat_interval`at `>= 10` seconds (`900`/ 15 min is the typical desktop default). `/auth/heartbeat` is limited to 6 requests/minute per license key, and revocations still take effect on the **next** heartbeat.
|`heartbeat_mode`|`str`| yes | — |`"SERVER"` or `"LOCAL"` (case-insensitive) |
64
-
|`heartbeat_interval`|`int`| no |`900`| Seconds between heartbeats (any value ≥ 1) |
64
+
|`heartbeat_interval`|`int`| no |`900`| Seconds between heartbeats (minimum `10`) |
65
65
|`api_base_url`|`str`| no |`https://auth.authforge.cc`| API base URL |
66
66
|`on_failure`|`Callable[[str, Optional[Exception]], None] \| None`| no |`None`| Called on login/heartbeat/network failure; if omitted, process exits via `os._exit(1)` (not used by `validate_license`) |
67
67
|`request_timeout`|`int`| no |`15`| HTTP timeout (seconds) |
-`rate_limited` and `replay_detected` can only be returned from`/auth/validate`. Heartbeats are not IP rate-limited and do not enforce nonce replay.
90
+
-`replay_detected` is validate-only. `rate_limited` can be returned by`/auth/validate` and `/auth/heartbeat` (heartbeat is license-limited at 6/min and has no app-layer IP limit).
-**10 heartbeats on the same license = 1 credit** (billed every 10th successful heartbeat).
72
72
73
-
A desktop app running 6h/day at a 15-minute interval burns ~3–4 credits/day. A server app running 24/7 at a 1-minute interval burns ~145 credits/day — pick the interval based on how fast you need revocations to propagate (they always land on the **next** heartbeat).
73
+
A desktop app running 6h/day at a 15-minute interval burns ~3–4 credits/day. The server enforces `/auth/heartbeat` at 6 requests/minute per license key, so keep intervals at 10 seconds or higher and pick the interval based on how fast you need revocations to propagate (they always land on the **next** heartbeat).
74
74
75
75
## Methods
76
76
@@ -98,7 +98,7 @@ If authentication fails (login rejected, heartbeat fails, signature mismatch, et
98
98
**`validate_license()`** does not trigger `on_failure` or `os._exit` — check `result["valid"]` and `result["code"]`.
0 commit comments