npm.io
1.0.6 • Published 3 years ago

@chatbot-ui/local-storage

Licence
MIT
Version
1.0.6
Deps
2
Size
32 kB
Vulns
31
Weekly
0
DeprecatedThis package is deprecated

Chatbot UI Local Storage

This extension provides local storage support to my custom version of Chatbot UI.

Installation

Installing this extension by hand is usually not required, as it ships with the base version of 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:

npm i @chatbot-ui/local-storage@latest
Step 2

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

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.

Keywords