UNPKG

@unkey/api

Version:

Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@unkey/api* API.

33 lines 2.14 kB
import { UnkeyCore } from "../core.js"; import { RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js"; import * as errors from "../models/errors/index.js"; import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; import { UnkeyError } from "../models/errors/unkeyerror.js"; import { APIPromise } from "../types/async.js"; import { Result } from "../types/fp.js"; /** * Get API key * * @remarks * Retrieve detailed key information for dashboard interfaces and administrative purposes. * * Use this to build key management dashboards showing users their key details, status, permissions, and usage data. You can identify keys by `keyId` or the actual key string. * * **Important**: Set `decrypt: true` only in secure contexts to retrieve plaintext key values from recoverable keys. * * **Required Permissions** * * Your root key must have one of the following permissions for basic key information: * - `api.*.read_key` (to read keys from any API) * - `api.<api_id>.read_key` (to read keys from a specific API) * * Additional permission required for decrypt functionality: * - `api.*.decrypt_key` or `api.<api_id>.decrypt_key` * * If set, this operation will use {@link Security.rootKey} from the global security. */ export declare function keysGetKey(client: UnkeyCore, request: components.V2KeysGetKeyRequestBody, options?: RequestOptions): APIPromise<Result<components.V2KeysGetKeyResponseBody, errors.BadRequestErrorResponse | errors.UnauthorizedErrorResponse | errors.ForbiddenErrorResponse | errors.NotFoundErrorResponse | errors.TooManyRequestsErrorResponse | errors.InternalServerErrorResponse | UnkeyError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>; //# sourceMappingURL=keysGetKey.d.ts.map