ValyroUI Русская версия

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

PropTypeDefault
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> | unknownRevokes the key; may return a promise (the confirm dialog waits and shows a failure).
onDelete(key: ApiKey) => Promise<unknown> | unknownRemoves 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.
defaultExpirationnumber | null30Default 30 days.
defaultScopesstring[]Scopes checked when the create dialog opens. Default: the first scope.
descriptionReactNodeText under the title.
localestringBCP 47 locale for dates. Default: the ThemeProvider locale, then the browser's.
labelsPartial<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