Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Web host

import { createWebHost } from '@enc-protocol/cvn/web'
const host = createWebHost()                          // localStorage, window timers, WebCrypto
const host2 = createWebHost({ storage: sessionStorage })

The store is localStorage unless a Storage-shaped object is handed in. That is also how the web host is tested in node without emulating a DOM: the contract is four methods (getItem, setItem, removeItem, key/length), and an object with those four is the dependency. If there is no localStorage and nothing is handed in, construction throws — a silent memory fallback would be a host that forgets on reload while claiming to persist.