API Key Manager
API keys: create with scopes and expiry, show the secret once, revoke. Pro · Developer tools › API and integrations
Create, list and revoke API keys; a new key's secret is shown exactly once.
Installation
npx valyro-cli@latest login
npx valyro-cli@latest add api-key-manager
npm install valyro-ui-pro
import 'valyro-ui-pro/styles.css';
import { ApiKeyManager } from 'valyro-ui-pro';
Props
| Prop | Type | Default | |
|---|---|---|---|
keys * | ApiKey[] | Keys to list, newest first. Add the created key in onCreate, drop or mark revoked ones in onRevoke. | |
scopes * | ApiKeyScope[] | Permissions offered when creating a key. | |
onCreate * | (input: ApiKeyInput) => Promise<{ secret: string }> | { secret: string } | Creates the key and resolves with its full secret, shown once. Reject to show the error in the dialog; the caller adds the new key to keys. | |
onRevoke * | (key: ApiKey) => Promise<unknown> | unknown | Revokes the key; may return a promise (the confirm dialog waits and shows a failure). | |
onDelete | (key: ApiKey) => Promise<unknown> | unknown | Removes an expired or revoked key; the caller drops it from keys. When given, those keys offer Delete in their menu instead of Revoke (a revoked key otherwise has no actions). May return a promise, like onRevoke. | |
expirationOptions | (number | null)[] | [7, 30, 90, 365, null] | Expiration choices in days; null means never. Default 7, 30, 90 days, 1 year, never. |
defaultExpiration | number | null | 30 | Default 30 days. |
defaultScopes | string[] | Scopes checked when the create dialog opens. Default: the first scope. | |
description | ReactNode | Text under the title. | |
locale | string | BCP 47 locale for dates. Default: the ThemeProvider locale, then the browser's. | |
labels | Partial<ApiKeyManagerLabels> | Overrides for the built-in English text; keys left out keep their defaults. |
Related components
- Api Playground — API playground: model, parameters, prompts and JSON request/response
- Webhook Endpoints — Webhooks: endpoints, events, toggles and delivery rate
- Certificate List — SSL/TLS certificates: time to expiry, auto-renewal, legend
- Code Block — Syntax-highlighted code
- Diff Viewer — Multi-file diff: file list with stats, unified and split views, word highlights
- Log Viewer — Streaming logs: levels, highlighted search, tail follow, JSON lines
- Request Inspector — HTTP request log: filters, headers, bodies and a timing waterfall
- Status Page — Status page: overall banner, 90-day uptime, incidents and subscriptions
- Storage Usage — Storage: usage by category and cleanup actions
- Download Center — Exports: file types, size, link expiry and re-request
- Feature Flag Simulator — Preview the product under different feature flags and segments, no production access
Previous: Request Inspector · Next: Api Playground · All Developer tools