---
title: KVStoreEntry
summary: Class for interacting with a Fastly KV store entry.
url: https://www.fastly.com/documentation/reference/compute/sdks/javascript/js-compute/kv-store/interface.KVStoreEntry/
---

**Kind:** Interface  
**Module:** [kv-store](https://www.fastly.com/documentation/reference/compute/sdks/javascript/js-compute/kv-store/)  
**Package:** @fastly/js-compute 4.0.1  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/kv-store.d.ts#L169

Class for interacting with a [Fastly KV store](https://developer.fastly.com/reference/api/kv-store/) entry.

## Properties

### body

**Type:** `ReadableStream`  
**Flags:** read-only  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/kv-store.d.ts#L173

A ReadableStream with the contents of the entry.

### bodyUsed

**Type:** `boolean`  
**Flags:** read-only  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/kv-store.d.ts#L178

A boolean value that indicates whether the body has been read from already.

## Methods

### arrayBuffer

**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/kv-store.d.ts#L194

```javascript
arrayBuffer(): Promise<ArrayBuffer>
```

Reads the body and returns it as a promise that resolves with an ArrayBuffer.

**Returns**

`Promise<ArrayBuffer>`

### json

**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/kv-store.d.ts#L189

```javascript
json(): Promise<object>
```

Reads the body and returns it as a promise that resolves with the result of parsing the body text as JSON.

**Returns**

`Promise<object>`

### metadata

**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/kv-store.d.ts#L203

```javascript
metadata(): ArrayBuffer | null
```

Binary metadata associated with this entry, up to 1000 bytes.

Returns `null` if no metadata is set.

**Returns**

`ArrayBuffer | null`

### metadataText

**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/kv-store.d.ts#L213

```javascript
metadataText(): string | null
```

Metadata associated with this entry, decoded as a UTF-8 string.

Returns `null` if no metadata is set.

**Returns**

`string | null`

**Throws**

- If the metadata is not valid UTF-8.

### text

**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/kv-store.d.ts#L184

```javascript
text(): Promise<string>
```

Reads the body and returns it as a promise that resolves with a string.
The response is always decoded using UTF-8.

**Returns**

`Promise<string>`
