# key

> **key**(`value`): [`KeyValue`](https://stage.docs.arkiv.network/typescript-sdk/api-reference/main/type-aliases/keyvalue/)

Defined in: [src/attr/values.ts:349](https://github.com/Arkiv-Network/arkiv-sdk-js/blob/488e08c3687cc5cfaf5dd8ab0fe0f7fed40930bb/src/attr/values.ts#L349)

A reference to another entity, indexed for equality.

References are **weak**: nothing checks that the target exists when you write it, and a
reference to a deleted or expired entity is allowed to dangle.

## Parameters

### value

A 32-byte entity key, as `0x` hex or raw bytes.

`` `0x${string}` `` | `Uint8Array`\<`ArrayBufferLike`\>

## Returns

[`KeyValue`](https://stage.docs.arkiv.network/typescript-sdk/api-reference/main/type-aliases/keyvalue/)

## Throws

If the value is not exactly 32 bytes.

## Example

```ts
key(parentEntityKey)
```