> ## 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 a typed key (ingestion or data plane) is set to
a value that is not a key of that kind. The message names where the value
came from and what it looks like instead, and never echoes the value.

## Extends

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

## Constructors

### Constructor

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

#### Parameters

##### keyKind

`"ingestion"` | `"dataPlane"`

##### source

`string`

##### requirement

`string`

#### Returns

`MalformedApiKeyError`

#### Overrides

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

### keyKind

> `readonly` **keyKind**: `"ingestion"` | `"dataPlane"`

The kind of key the value was supplied as.

***

### 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/control-plane-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.