Installation¶
This page covers requirements, install steps, and peer dependencies for Vecnest.
Requirements¶
- Node.js 18+ (for
npm/pnpm/yarn). - Browser with IndexedDB support (all modern browsers).
- Optional: React 18+ if you use
vecnest/reacthooks.
Vecnest runs entirely in the browser. No Node.js backend is required at runtime.
Install¶
npm¶
pnpm¶
yarn¶
Peer dependencies¶
| Package | Required? | Notes |
|---|---|---|
react |
Optional | Only if you use vecnest/react (useVecnest, useSearch, useSearchText). Minimum >=18.0.0. |
If you use the core API only (no React hooks), you do not need to install React.
Embeddings (Transformers.js)¶
When you use addText or searchText, Vecnest uses Transformers.js to embed text in the browser. The model is fetched on first use and cached. No extra install is required—Transformers.js is included as a dependency of Vecnest.
Verify install¶
In a browser environment (e.g. Vite, Next.js, or a simple HTML page with a bundler):
import { VecnestDB } from 'vecnest';
const db = new VecnestDB('test-db');
await db.connect();
console.log('Vecnest connected.');
db.close();
If this runs without errors, you're ready to use Vecnest. Next: Quick start.