Client persistence plugin
Preserve chat history in the browser, by using an IndexedDB database.
Installation
npm
npm i @tarvis/client-persistence
Basic Usage
import {
createChatUIContext,
ChatUI,
} from '@tarvis/client';
import PersistencePlugin from '@tarvis/client-persistence';
import '@tarvis/client/dist/index.css'
const config = {
// other config
plugins: [new PersistencePlugin()]
};
const ctx = createChatUIContext(config);
const chatUI = new ChatUI(ctx);
const chatEl = document.getElementById('app');
chatUI.render(chatEl);
Last updated on