> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tappify.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# TapSingleton

> The handle tap.storage.<name> exposes for a singleton collection, which holds one document per scope key.

The handle `tap.storage.<name>` exposes for a singleton collection, which holds
one document per scope key.

## Remarks

A collection is a singleton when the manifest declares it with `singleton` set
to `true`. Every call needs the `storage:write` scope, `get` included.

## Type Parameters

### T

`T`

## Methods

### get()

```ts theme={null}
get(): Promise<T | null>;
```

Resolves to `null` until the document has been written once.

#### Returns

`Promise`\<`T` | `null`>

***

### patch()

```ts theme={null}
patch(partial): Promise<T>;
```

Merges the fields into the document and resolves to the merged document.

#### Parameters

##### partial

`Partial`\<`T`>

#### Returns

`Promise`\<`T`>

***

### set()

```ts theme={null}
set(document): Promise<void>;
```

Replaces the whole document.

#### Parameters

##### document

`T`

#### Returns

`Promise`\<`void`>
