Skip to main content
@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.

Install

Also works with pnpm add, yarn add, bun add.

Authenticate

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.

First query

Constructor options

Usage across runtimes

Next steps

Querying

query, queryStream, response modes, depth.

Knowledge

insert, uploadFile, polling async jobs.

Conversations

Multi-turn sessions with startConversation + continueConversation.

Error handling

Typed exception hierarchy you can switch on.

Error handling

All errors extend VrinError. Import the specific subclasses you want to handle:
VrinError exposes:
  • message — human-readable description
  • status? — HTTP status, when relevant
  • body? — raw server payload, for logging

Custom fetch

For runtimes without a global fetch (Node 16, some embedded envs) or when you want a middleware-style interceptor: