---
title: BaseKVStore
slug: data-platform/connect-platform/app-sdk-api-reference-interfaces-basekvstore
docTags: 
createdAt: 2026-08-05T20:06:36.783Z
---

[OCP App SDK](docId\:gxEU_0AA37IEZJK-uoVcT)

***

[OCP App SDK](docId\:gxEU_0AA37IEZJK-uoVcT) / BaseKVStore

# Interface: BaseKVStore\<T, R>

Defined in: [src/store/BaseKVStore.ts:27](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/BaseKVStore.ts#L27)

The base interface all key-value stores implement

## Extended by

- [`` `KVStore` ``](docId\:VVwF40txfuusUhLX_lz-H)

## Type Parameters

### T

`T` = [`` `ValueHash` ``](docId\:iBlCGxR75KaoapohMUe5k)

### R

`R` = `true`

## Methods

### delete()

:::BlockQuote
**delete**\<`V`>(`key`, `fields?`): `Promise`\<`R` *extends* `T` ? `V` : `R`>
:::

Defined in: [src/store/BaseKVStore.ts:76](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/BaseKVStore.ts#L76)

Delete an object or a single field from the store at a given key.
If fields is undefined, the entire object will be deleted.

### Type Parameters

### V

`V`

### Parameters

### key

`string`

of the stored object

### fields?

`string`\[]

to delete or undefined to delete all fields

### Returns

`Promise`\<`R` *extends* `T` ? `V` : `R`>

true if successful. Otherwise throws an error.

### Async

***

### exists()

:::BlockQuote
**exists**(`key`): `Promise`\<`boolean`>
:::

Defined in: [src/store/BaseKVStore.ts:84](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/BaseKVStore.ts#L84)

Check if an object exists at a given key.

### Parameters

### key

`string`

of the stored object

### Returns

`Promise`\<`boolean`>

true if the object exists

### Async

***

### get()

:::BlockQuote
**get**\<`V`>(`key`, `fields?`): `Promise`\<`V`>
:::

Defined in: [src/store/BaseKVStore.ts:36](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/BaseKVStore.ts#L36)

Retrieve an object from the store given a key.

### Type Parameters

### V

`V`

### Parameters

### key

`string`

of the stored object

### fields?

`string`\[]

to retrieve from the stored object, or undefined to retrieve the full object

### Returns

`Promise`\<`V`>

hash of the complete object or only the specified fields, if supplied.
An empty object is returned if the object, or all specified fields, does not exist.

### Async

***

### patch()

### Call Signature

:::BlockQuote
**patch**\<`V`>(`key`, `value`): `Promise`\<`V`>
:::

Defined in: [src/store/BaseKVStore.ts:55](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/BaseKVStore.ts#L55)

Write a set of fields to an object in the store at a given key. Does not overwrite the entire object.

### Type Parameters

### V

`V`

### Parameters

### key

`string`

of the stored object

### value

`V`

hash of fields and values to update the object with. Leaves all other fields untouched.

### Returns

`Promise`\<`V`>

the complete object from before the update
An empty object is returned if the object previously did not exist.

### Async

### Call Signature

:::BlockQuote
**patch**\<`V`>(`key`, `updater`): `Promise`\<`V`>
:::

Defined in: [src/store/BaseKVStore.ts:66](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/BaseKVStore.ts#L66)

Update a stored object using a callback to make changes.

### Type Parameters

### V

`V`

### Parameters

### key

`string`

of the stored object

### updater

[`` `PatchUpdater` ``](docId\:NNqKcbW6y6Rdamt8RC4Mv)\<`V`>

function to manipulate the existing object (may be called multiple times to ensure an atomic change)

### Returns

`Promise`\<`V`>

the complete object from before the update
An empty object is returned if the object previously did not exist.

### Async

***

### put()

:::BlockQuote
**put**\<`V`>(`key`, `value`): `Promise`\<`R` *extends* `T` ? `V` : `R`>
:::

Defined in: [src/store/BaseKVStore.ts:45](https://github.com/ZaiusInc/app-sdk/blob/8c7209817facb226c91abb960e6d54a7692b9aa2/src/store/BaseKVStore.ts#L45)

Write an object to the store at a given key. Overwrites the entire object.

### Type Parameters

### V

`V`

### Parameters

### key

`string`

of the stored object

### value

`V`

complete hash to write

### Returns

`Promise`\<`R` *extends* `T` ? `V` : `R`>

true if successful. Otherwise throws an error.

### Async
