# @chatbot-ui/local-storage

> Local storage support for the Chatbot UI project.

Latest version **1.0.6** (published 2023-06-09) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @chatbot-ui/local-storage
pnpm add @chatbot-ui/local-storage
yarn add @chatbot-ui/local-storage
bun add @chatbot-ui/local-storage
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2023-06-09 |
| First published | 2023-05-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 32.4 KB |
| Known vulnerabilities | 0 (+31 in 1 direct dependencies) |
| Install scripts | no |
| Author | Jorge Menjivar |
| Maintainers | jmen900 |
| Keywords | react, nodejs, nextjs, database, chatbot, chatbot-ui |

## Links

- npm: https://www.npmjs.com/package/@chatbot-ui/local-storage
- Repository: https://github.com/jorge-menjivar/chatbot-ui-local-storage
- Homepage: https://github.com/jorge-menjivar/chatbot-ui-local-storage#readme
- Issues: https://github.com/jorge-menjivar/chatbot-ui-local-storage/issues
- npm.io page: https://npm.io/package/@chatbot-ui/local-storage

## Dependencies (2)

- [next](https://npm.io/package/next.md) ^13.2.4
- [@chatbot-ui/core](https://npm.io/package/@chatbot-ui/core.md) ^1.0.12

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.6 (latest) — 2023-06-09
- 1.0.5 — 2023-06-09
- 1.0.4 — 2023-06-09
- 1.0.3 — 2023-06-08
- 1.0.2 — 2023-06-05
- 1.0.1 — 2023-05-16
- 1.0.0 — 2023-05-16

## README

# Chatbot UI Local Storage

This extension provides local storage support to my custom version of [Chatbot UI](https://github.com/jorge-menjivar/chatbot-ui).

## Installation

Installing this extension by hand is usually not required, as it ships with the base version of [Chatbot UI](https://github.com/jorge-menjivar/chatbot-ui). However, if you replaced this extension with a database extension, then you can re-install with the following steps:

### Step 1

Install the local storage extension with npm:

```sh
npm i @chatbot-ui/local-storage@latest
```

### Step 2

Update `/utils/app/storage.ts` to use the local storage:

```typescript
import { Database } from '@chatbot-ui/core';
import { LocalDatabase } from 'chatbot-ui-local-storage';

// <-----Update here

let database: Database | null = null;

export const getDatabase = async () => {
  if (database) {
    return database;
  } else {
    database = new LocalDatabase(); // <-----Update here
    await database.connect();
    return database;
  }
};
```

That's it.

---
_Source: https://npm.io/package/@chatbot-ui/local-storage · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
