Components › Blocks

API keys

A project's API keys, masked, with created and last-used dates, a create button and a confirmed revoke.

Installation

npx plankui@latest add api-keys

Usage

import { ApiKeys } from "@/components/ui/api-keys";

<ApiKeys keys={keys} onCreate={createKey} onRevoke={revokeKey} />

API reference

PropTypeDefaultDescription
keys{ id, name, last4, prefix?, created, lastUsed? }[]requiredThe keys, shown masked.
onCreate() => voidShows the Create key button.
onRevoke(id: string) => voidCalled after the visitor confirms.

View the source on GitHub