### Install keyv and keyv-browser Source: https://github.com/zaaack/keyv-browser/blob/master/README.md Install the necessary packages for using keyv-browser with Keyv. ```shell npm install --save keyv keyv-browser ``` -------------------------------- ### Initialize Keyv with localStorage Source: https://github.com/zaaack/keyv-browser/blob/master/README.md Initialize a Keyv instance using KeyvLocalStorage for browser localStorage. ```ts import Keyv from 'keyv' import { KeyvLocalStorage, KeyvIndexedDB } from 'keyv-browser' // localStorage const keyv = new Keyv ({ store: new KeyvLocalStorage() }); // indexedDB const keyv2 = new Keyv ({ store: new KeyvIndexedDB() }) ``` -------------------------------- ### Use keyv-browser directly with custom fields Source: https://github.com/zaaack/keyv-browser/blob/master/README.md Demonstrates creating a custom KeyvLocalStorage class with managed fields using makeField. ```ts import { KeyvLocalStorage, makeField } from 'keyv-browser' class Kv extends KeyvLocalStorage { someField = makeField(this, 'field_key', 0) } export const kv = new Kv await kv.someField.get(1) // empty return default value 1 await kv.someField.set(2) // set value 2 await kv.someField.get() // return saved value 2 await kv.someField.delete() // delete field ``` -------------------------------- ### Add keyv-browser skill using npx Source: https://github.com/zaaack/keyv-browser/blob/master/README.md Add the keyv-browser skill to your AI agent using npx. ```shell npx skills add https://github.com/zaaack/prompts --skill keyv-browser ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.