KQ-1666 · TOKEN/LOCKER

Token Locker

API token management where a new token is shown once: its characters resolve in place left to right inside 600ms beside a Copy button and a ring that drains linearly, paused under the pointer, then the mask sweeps across a step per character and the panel folds back into its row on springs.glide. Revoking strikes the name through on springs.flick and, a beat later, the row slides down into Revoked as one shared-layout move on glide. Tab reaches every action, C copies the revealed secret, Escape closes a confirm or the create form, and onCreate, onRotate and onRevoke fire.

KQ-1666 · TOKEN/LOCKER

API tokens

Gaugeworks · 4 active tokens · 1 revoked

  • Ingest bot

    gw_live_3f9a
    Scopes
    readings:writegauges:read
    Last used
    2h ago
    Expires
    Jun 3, 2027
  • Lobby dashboard

    gw_live_a71c
    Scopes
    readings:readgauges:read
    Last used
    3d ago
    Expires
    No expiry
  • Legacy importer

    Unused 90+ days
    gw_live_0d2e
    Scopes
    readings:write
    Last used
    5 months ago
    Expires
    in 8 days
  • Billing export

    gw_live_c45b
    Scopes
    workspace:billing
    Last used
    Never
    Expires
    in 49 days

Revoked1

  • Old CI runner

    Revoked Sep 2, 2026
    gw_live_77e0
    Scopes
    gauges:readreadings:read
    Last used
    2 months ago
    Expires
    —

gaugeworks · 4 active · 1 revoked

Install

One command — the source lands in your repo. Or copy it from the Code tab.

$ pnpm dlx shadcn@latest add @kinetiq/token-locker

Props

tokens
LockerToken[]
default defaultLockerTokens
Seeds the tokens ({ id, name, scopes, created, lastUsed, expires, hint, revoked? }); the locker owns them after that and reports every change.
scopes
LockerScope[]
default defaultLockerScopes
The scopes on offer, { id, label, group }, shown as grouped checkboxes under tri-state group boxes.
onTokensChange
(tokens: LockerToken[]) => void
default —
Fires with every token after a create, rotate or revoke.
onCreate
(draft: LockerDraft) => LockerSecret | Promise<LockerSecret>
default —
Create was confirmed with { name, scopes, expiresInDays }. Return the new secret (or a promise of it); without one a seeded placeholder is minted. A rejection is reported in the form.
onRotate
(token: LockerToken) => LockerSecret | Promise<LockerSecret>
default —
Rotate was confirmed. Return the replacement secret, as for onCreate; it is shown once in the token's row.
onRevoke
(token: LockerToken) => void | Promise<unknown>
default —
Revoke was confirmed. A rejection leaves the token active and says so.
now
number
default defaultLockerNow
Now in ms, for last used, expiry and the stale flag.
revealSeconds
number
default 30
How long a new secret stays readable before it is masked for good, seconds.
staleDays
number
default 90
A token unused for this many days (or never used and this old) is flagged.
prefix
string
default "gw_live_"
Printed before every secret and every stored hint.
workspace
string
default "Gaugeworks"
The workspace the tokens belong to, named in the header and the empty state.
status
"ready" | "loading" | "error"
default "ready"
Whether the tokens have loaded; loading shows skeleton rows, error offers Try again.
onRetry
() => void
default —
Try again was pressed after the tokens failed to load.
maskStyle
"blur" | "dots" | "bars"
default "blur"
How a secret is hidden, in the sweep and at rest: blurred, dotted out, or redacted with bars.
density
"compact" | "regular" | "roomy"
default "regular"
Row padding, button height and type size.
palette
"cobalt" | "signal" | "amber" | "graphite"
default "cobalt"
The reveal panel's wash, the countdown ring, the resolve and the primary buttons.
title
string
default "API tokens"
The heading and the locker's accessible name.
height
number
default 520
Height of the locker, px; the list scrolls inside.
disabled
boolean
default false
Create, rotate and revoke are inert; the locker dims.
className
string
default —
Classes for the outer locker.