Optionalopts: {Cancels all rotation timers (call on shutdown).
Removes the grant for key, optionally revoking it at the AS: the whole grant (section 5.4), or with
revoke: 'token' only its access token (section 6.2).
Optionalopts: { revoke?: boolean | "token" | "grant" } = {}The cached grant (possibly expired) for key.
Returns the cached grant for key, rotating first if the access token is (nearly) expired.
Optionalopts: { forceRefresh?: boolean } = {}Rotates key's access token now. Concurrent calls share a single request.
Schedules the proactive rotation of the token already stored for key.
Stops rotating key's token in the background; it stays stored.
Caches GrantSets per key (typically one per signed-in person) and keeps their access tokens fresh by GNAP token rotation (RFC 9635 section 6.1).
getTokenSet(key)always returns a token valid for at leastrefreshSkewSec, rotating on demand.autoRefresh(default), a timer rotates each tokenrefreshSkewSecbefore it expires.Events: "rotated" (key, grantSet) — a new access token obtained by rotation "rotation_error" (key, error) — rotation failed (tokens are dropped when the grant is gone) "expired" (key) — tokens for key could not be renewed and were removed "removed" (key) — tokens deleted via delete()