# getVariantKey

> **getVariantKey**\<`T`\>(`variant`): [`CandidVariantKey`](../type-aliases/CandidVariantKey.md)\<`T`\>

Defined in: [utils/candid.ts:71](https://github.com/B3Pay/ic-reactor/blob/452866bcf5c5994de1f73416e6a3b2d18e4188fa/packages/core/src/utils/candid.ts#L71)

Extracts the key from a Candid variant type.
Variants in Candid are represented as objects with a single key-value pair.

## Type Parameters

### T

`T` *extends* `Record`\<`string`, `any`\>

## Parameters

### variant

`T`

The variant object

## Returns

[`CandidVariantKey`](../type-aliases/CandidVariantKey.md)\<`T`\>

The key of the variant