Skip to content
rw3iss Auth

TokenExpiryCountdown

atom @rw3iss/auth-client/preact/atoms/TokenExpiryCountdown framework-adapters/preact/components/atoms/TokenExpiryCountdown.tsx ↗

Live countdown to the cached access token’s expiry. Re-renders once per second while the user is authenticated. After expiry, shows “expired” until the auto-refresh path mints a new token.

The countdown reads cachedClaims.exp from the AuthClient snapshot, NOT a separate timer — so it stays consistent across tabs and survives refresh/cross-tab token updates without manual coordination.

Primarily a debug/visibility component; useful in admin dashboards.

Usage

import { TokenExpiryCountdown } from '@rw3iss/auth-client/preact/atoms';
<TokenExpiryCountdown />

Props

NameTypeDescription
clientAuthClient
classNamestring
format(secondsRemaining: number) => stringOverride the format. Receives whole seconds remaining (may be negative).