@unkey/api
Version:
Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@unkey/api* API.
42 lines • 1.85 kB
TypeScript
import * as z from "zod/v3";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
export type V2KeysRerollKeyResponseData = {
/**
* The unique identifier for the newly created key.
*
* @remarks
*
* This is NOT the actual API key token, but a reference ID for management operations.
* Store this ID to:
* - Update or revoke the key later
* - Track the key in your database
* - Display in admin dashboards (safe to log)
*
* Note: This is a new ID - the original key retains its own ID.
*/
keyId: string;
/**
* The newly generated API key token (the actual secret that authenticates requests).
*
* @remarks
*
* **SECURITY CRITICAL:**
* - This is the only time you'll receive the complete key
* - Unkey stores only a hashed version (unless the original key was created with `recoverable=true`)
* - Never log, store, or expose this value in your systems
* - Transmit directly to the end user via secure channels only
* - If lost and not recoverable, you must reroll or create a new key
*
* The key format follows: `[prefix]_[random_bytes]`
* - Prefix is extracted from the original key or uses API default
* - Random bytes follow API configuration (default: 16 bytes)
*
* This is NOT the keyId - it's the actual secret token used for authentication.
*/
key: string;
};
/** @internal */
export declare const V2KeysRerollKeyResponseData$inboundSchema: z.ZodType<V2KeysRerollKeyResponseData, z.ZodTypeDef, unknown>;
export declare function v2KeysRerollKeyResponseDataFromJSON(jsonString: string): SafeParseResult<V2KeysRerollKeyResponseData, SDKValidationError>;
//# sourceMappingURL=v2keysrerollkeyresponsedata.d.ts.map