Function: maskApiKey()
@providerprotocol/ai / http / maskApiKey
Function: maskApiKey()
Section titled “Function: maskApiKey()”maskApiKey(
key):string
Defined in: src/http/keys.ts:165
Masks an API key for safe logging. Shows first 4 and last 4 characters with ellipsis, or ’***’ for short keys.
Parameters
Section titled “Parameters”string
The API key to mask
Returns
Section titled “Returns”string
Masked key like “sk-ab…yz12” or ”***” for short keys
Example
Section titled “Example”maskApiKey('sk-abc123def456xyz789'); // 'sk-a...z789'maskApiKey('short'); // '***'