Prodular UI

Data display

API keysPro

API keys for a workspace: create with scopes and an expiry, see the secret once, rotate and revoke with confirmation, and see when and where each key was last used. Every change goes through your callbacks.

npx prodular-ui add api-keys

Part of Prodular UI Pro. Preview and read the docs freely, install with a license. See pricing

Developer settings

Create a key to see the one-time reveal. One key expires in 6 days and one has expired. Revoke asks you to type the key name.

API keys

3 keys

  • NetSuite syncrl_live_8f2a••••••••
    Read invoicesRecord payments+1
    Used 2 hours agofrom 34.120.18.6
    Expires Sep 3, 2027
  • Data warehouse exportrl_live_c71d••••••••
    Read invoicesRead payments
    Used 2 days agofrom Snowflake
    Expires Oct 28, 2026
  • Old Zapier keyrl_live_0b44••••••••
    Manage webhooks
    Never usedCreated Apr 12, 2026
    Expired Oct 12, 2026

Anatomy

<ApiKeysManager  keys={keys}  scopes={scopes}  onCreate={createKey}  onRotate={rotateKey}  onRevoke={revokeKey}/>

Guidance

Use it when

  • Developer settings where customers create keys for their own integrations.
  • One key per service, with only the scopes it needs, so one can be rotated without touching the rest.
  • Expiry by default; never only when people choose it on purpose.

Avoid

  • Showing or storing the full secret after creation. The list only ever shows the prefix.
  • Personal access tokens with sign in semantics. Those belong in the account security page.

Rules for AI agents

Published in llms-full.txt and the registry, so coding agents follow them when they build with this component.

  • Store only a hash of the secret and its prefix on the server. onCreate and onRotate return { key, secret } once; never return the secret again.
  • Pass keys as { id, name, prefix, scopes, createdAt, createdBy?, expiresAt?, lastUsedAt?, lastUsedFrom? } and scopes as { id, label, description?, group? }.
  • Throw from onCreate, onRotate or onRevoke to show the error in the dialog; the dialog stays open.
  • Rotate replaces the secret at once. If you support a grace period, say so in your own docs and keep the old hash valid server side.
  • Pass now and timeZone in tests and demos so expiry warnings and relative times are stable.

API

ApiKeysManager

PropTypeDefaultDescription
keys / scopesApiKey[] / ApiScope[]Existing keys and the scopes people can grant.
onCreate(input: { name, scopes, expiresInDays }) => Promise<{ key, secret }>Creates a key. The secret shows once.
onRotate(key) => Promise<{ key, secret }>Replaces a key's secret.
onRevoke(key) => Promise<void>Revokes after typing the key name.
expiryOptions(number | null)[][30, 90, 365, null]Days a new key lasts; null never expires.
defaultScopesstring[][]Ticked when the create dialog opens.
now / timeZoneDate / stringClock and zone for dates and warnings.