Use this file to discover all available pages before exploring further.
@vrin/sdk is the official TypeScript client. It works in Node 18+, Bun, Deno, Cloudflare Workers, and modern browsers. Written in TypeScript, shipped as both ESM and CJS, fully typed.If you’re building an agent in Python, use the Python SDK. If you’re shell-scripting, use the CLI.
import { VrinClient } from "@vrin/sdk";const client = new VrinClient({ apiKey: process.env.VRIN_API_KEY });
The API key starts with vrin_live_ (shared infra) or vrin_ent_ (enterprise-routed). Get one at vrin.cloud → Dashboard → API Keys.If apiKey is omitted, the client reads VRIN_API_KEY from process.env.
Never expose a raw Vrin API key in client-side JavaScript. Proxy through your own backend and call Vrin from there. The browser example below assumes a trusted internal tool context.
import { VrinClient } from "@vrin/sdk";const client = new VrinClient({ apiKey: "vrin_live_..." });
All errors extend VrinError. Import the specific subclasses you want to handle:
import { VrinClient, VrinError, AuthenticationError, RateLimitError, ValidationError, ServiceUnavailableError, TimeoutError, InsufficientCoverageError,} from "@vrin/sdk";try { const r = await client.query({ query: "..." });} catch (err) { if (err instanceof AuthenticationError) { // bad key — prompt the user to re-auth } else if (err instanceof RateLimitError) { // back off; err.retryAfterSeconds is populated if the server sent a Retry-After header await sleep((err.retryAfterSeconds ?? 1) * 1000); } else if (err instanceof InsufficientCoverageError) { // knowledge base has no relevant facts — ingest more or broaden the query } else if (err instanceof TimeoutError) { // request exceeded timeoutMs — retry with a longer timeout or split the query } else if (err instanceof VrinError) { console.error("Vrin error:", err.status, err.message); } else { throw err; }}
For runtimes without a global fetch (Node 16, some embedded envs) or when you want a middleware-style interceptor:
import { VrinClient } from "@vrin/sdk";import { fetch as undiciFetch } from "undici";const client = new VrinClient({ apiKey: process.env.VRIN_API_KEY, fetch: undiciFetch as unknown as typeof fetch,});