Skip to main content

TypeScript SDK - Installation

Requirements

  • Node.js 18+
  • TypeScript 5.0+ (optional but recommended)

Install

npm install @veclabs/solvec
yarn add @veclabs/solvec
pnpm add @veclabs/solvec
Get your API key at app.veclabs.xyz, then:
// Get your API key at app.veclabs.xyz
import { SolVec } from "@veclabs/solvec";

const sv = new SolVec({ apiKey: "vl_live_..." });
const collection = sv.collection("my-collection", { dimensions: 1536 });
VecLabs manages your Solana wallet, Shadow Drive storage, and Merkle root posting automatically.

Self-hosted mode

Bring your own Solana wallet and manage your own storage:
import { SolVec } from "@veclabs/solvec";

const sv = new SolVec({ network: "devnet" });

// Or specify a wallet keypair path
const sv2 = new SolVec({
  network: "devnet",
  walletPath: "/path/to/keypair.json",
});

Networks

NetworkUse for
devnetDevelopment and testing - free SOL from faucet
mainnet-betaProduction - real SOL required

TypeScript configuration

VecLabs ships with full TypeScript types. No @types package needed.

Verify installation

import { SolVec } from "@veclabs/solvec";

const sv = new SolVec({ network: "devnet" });
const collection = sv.collection("test", { dimensions: 4 });

await collection.upsert([
  {
    id: "test_001",
    values: [0.1, 0.2, 0.3, 0.4],
    metadata: { text: "Installation test" },
  },
]);

const results = await collection.query({
  vector: [0.1, 0.2, 0.3, 0.4],
  topK: 1,
});

console.log("Installation successful:", results[0].id);
// Installation successful: test_001

Next steps


Coming: @veclabs/recall

The intelligence layer ships as a separate package in Phase 7.
# coming soon
npm install @veclabs/recall
@veclabs/recall depends on @veclabs/solvec. Install both together.