# Function: grantStore()

```ts
function grantStore(storage?, key?): object;
```

Defined in: [packages/core/src/session/connect.ts:710](https://github.com/leifriksheim/minca/blob/main/core/src/session/connect.ts#L710)

Where an app keeps its grants between visits: one per account, each made
out to a key of its own, so two accounts never show peers one key.

## Parameters

| Parameter | Type | Default value |
| ------ | ------ | ------ |
| `storage?` | [`KeyValueStore`](https://minca.dev/api/session/interfaces/KeyValueStore.md) \| `null` | `...` |
| `key?` | `string` | `'minca.grants'` |

## Returns

### forget

```ts
forget: (did) => void;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `did` | `string` |

#### Returns

`void`

### get

```ts
get: (did) => KeptGrant | null;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `did` | `string` |

#### Returns

[`KeptGrant`](https://minca.dev/api/session/interfaces/KeptGrant.md) \| `null`

### list

```ts
list: () => readonly KeptGrant[] = all;
```

Every account, the one connected first first; an expired grant stays, to show and renew

#### Returns

readonly [`KeptGrant`](https://minca.dev/api/session/interfaces/KeptGrant.md)[]

### save()

```ts
save(grant, keyName): void;
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `grant` | [`Grant`](https://minca.dev/api/session/interfaces/Grant.md) |
| `keyName` | `string` |

#### Returns

`void`
