@vectros-ai/sdk
v0.34.0
Published
Vectros AI Platform SDK for Node.js
Readme
Vectros SDK for TypeScript / Node.js
The official TypeScript client for the Vectros API — hybrid search, document ingestion, structured records, and grounded inference for your application.
Installation
npm install @vectros-ai/sdkRequires Node.js 18+. Ships with TypeScript types.
Quick start
import { VectrosClient } from "@vectros-ai/sdk";
const client = new VectrosClient({
environment: "https://api.vectros.ai",
token: process.env.VECTROS_API_KEY!, // sk_live_... or sk_test_...
});
// Hybrid (keyword + semantic) search over your indexed content
const results = await client.search.content({
query: "patient intake form diabetes",
});
// Ingest a document — extracted, chunked, and indexed for search + RAG
const doc = await client.documents.ingestDocument({
body: {
title: "Patient Intake Form — Jane Doe",
},
});
// Write a structured record against one of your schemas
const record = await client.records.createRecord({
body: {
typeName: "intake_form",
schemaId: "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
payload: { first_name: "Jane", email: "[email protected]" },
},
});Authentication
The SDK sends whatever credential you pass in the Authorization: Bearer <token>
header. Two credential types are accepted:
| Type | Prefix | Lifetime | Use from |
|------|--------|----------|----------|
| API key | sk_live_* / sk_test_* | Long-lived | Server only — full tenant access |
| Scoped token | st_* | Short-lived | Server or browser — narrowed scope, auto-expiring |
Put an API key only on your server. For browser code, mint a short-lived scoped
token on your backend and pass it (or a token-supplier function) to the client —
never ship an API key to the browser. The token option accepts either a string
or an async supplier, so refresh logic lives in one place:
const client = new VectrosClient({
environment: "https://api.vectros.ai",
token: async () => getFreshScopedToken(), // your backend mint call
});See the authentication guide for the full browser token-minting pattern.
What you can do
- Hybrid search & RAG —
client.search,client.inference— vector + keyword search and grounded document Q&A over your indexed corpus. - Documents & folders —
client.documents,client.folders— ingest, organize, retrieve, and look documents up by field. - Structured records —
client.records— create, read, update (full and partial), delete, and look records up by indexed field. - Schemas —
client.schemas— define and evolve record/document schemas. - Identity & access —
client.identity,client.auth— manage clients, organizations, and users; mint and revoke scoped credentials.
Rate limits
Requests are rate limited per account on a fixed one-minute window — writes, searches, and
inference count against it; reads do not. When you exceed the limit the API returns HTTP 429
with a Retry-After header (seconds until the window resets) plus X-RateLimit-Limit and
X-RateLimit-Remaining. Honor Retry-After (or back off exponentially with jitter), and pace
bulk work so your steady rate stays under your plan's per-minute budget. See the
rate limits guide for the
per-plan limits.
Documentation
- Guides & reference: docs.vectros.ai
- Product: vectros.ai
Security & trust
Vectros enforces per-customer, fail-closed isolation and least-privilege scoped keys, with a tamper-evident audit and version history. Customer-facing surfaces are hardened through extensive adversarial security review. For the full trust posture, drawn plainly with its boundaries, see the compliance and trust guide.
