# Kv

`class` in `core` · v0.12.0

<https://seedcord.org/docs/packages/core/0.12.0/classes/kv>

The bot's key-value store, or one prefixed slice of it. `core.kv` holds your handlers' records. A
plugin's `this.kv` holds the plugin's.

```ts
class Kv
```

## Constructors

### constructor

```ts
Kv(driver: ConfiguredDriver, path: string[])
```

Constructs a new instance of the `Kv` class

## Properties

### driver

```ts
public readonly driver: ConfiguredDriver
```

What you passed as `config.kv`. Register its type in `KvTypes` to call the library's own methods on it.

## Methods

### collection

```ts
public collection<TRecord>(
    name: CollectionName<TRecord>
): KvCollection<TRecord>
```

Records of one type under `name`. Pass the type argument. A record type holding a function,
`Map`, `Set`, or `bigint` fails to compile here.
