API Key Manager
API-ключи: создание с правами и сроком, показ секрета один раз, отзыв. Pro · Разработчикам › API и интеграции
Установка
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';
Пропсы
| 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. |
Похожие компоненты
- Api Playground — Песочница API: модель, параметры, промпты и запрос/ответ в JSON
- Webhook Endpoints — Вебхуки: адреса, события, включение и доля доставок
- Certificate List — Сертификаты SSL/TLS: срок до истечения, автопродление, легенда
- Code Block — Код с подсветкой
- Diff Viewer — Дифф нескольких файлов: список со статистикой, unified и split, подсветка слов
- Log Viewer — Потоковые логи: уровни, поиск с подсветкой, слежение за хвостом, JSON-строки
- Request Inspector — Журнал HTTP-запросов: фильтры, заголовки, тела и водопад таймингов
- Status Page — Страница статуса: общий баннер, аптайм за 90 дней, инциденты и подписка
- Storage Usage — Хранилище: занятое место по категориям и действия по очистке
- Download Center — Выгрузки: типы файлов, размер, срок ссылки и повторный запрос
- Feature Flag Simulator — Превью продукта при разных фичефлагах и сегментах, без доступа к продакшену
Назад: Request Inspector · Далее: Api Playground · Весь раздел «Разработчикам»