> ## Documentation Index
> Fetch the complete documentation index at: https://docs.honeyhive.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# MalformedApiKeyError

> Error class thrown by the HoneyHive TypeScript SDK

Thrown at construction when the control plane API key is set to a value that
is not a fine-grained control plane key. The message names where the value
came from and what it looks like instead, and never echoes the value.

## Extends

* [`HoneyHiveError`](/v2/control-plane-sdk-reference/typescript/ref/classes/HoneyHiveError)

## Constructors

### Constructor

> **new MalformedApiKeyError**(`source`, `requirement`): `MalformedApiKeyError`

#### Parameters

##### source

`string`

##### requirement

`string`

#### Returns

`MalformedApiKeyError`

#### Overrides

[`HoneyHiveError`](/v2/control-plane-sdk-reference/typescript/ref/classes/HoneyHiveError).[`constructor`](/v2/control-plane-sdk-reference/typescript/ref/classes/HoneyHiveError#constructor)

### source

> `readonly` **source**: `string`

The option or environment variable the value came from.

***

### messageFor()

> **messageFor**(`source`): `string`

The same message with `source` named as where the value came from, for a
caller that supplied the value under a different name.

#### Parameters

##### source

`string`

#### Returns

`string`

***


## Related topics

- [MalformedApiKeyError](/v2/sdk-reference/typescript/ref/classes/MalformedApiKeyError.md)
- [HoneyHiveError](/v2/sdk-reference/typescript/ref/classes/HoneyHiveError.md)
- [Clients](/v2/changelog/clients.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.