Skip to main content

Requirements

  • Node.js 18 or later
  • TypeScript 5.0 or later (recommended)
  • The SDK is ESM-only. CommonJS (require()) is not supported.

Install

npm install @verial-ai/sdk

Configure

Create a client instance with your API key:
import Verial from '@verial-ai/sdk'

const verial = new Verial({
  apiKey: process.env.VERIAL_API_KEY,
})

Configuration Options

OptionTypeDefaultDescription
apiKeystringRequiredYour Verial API key (starts with vk_)
baseUrlstringhttps://api.verial.aiAPI base URL (override for self-hosted or staging)
timeoutnumber30000Request timeout in milliseconds
maxRetriesnumber2Number of automatic retries on failure

Custom Base URL

For development or self-hosted deployments:
const verial = new Verial({
  apiKey: process.env.VERIAL_API_KEY,
  baseUrl: 'http://localhost:3001',
})

ESM Configuration

The SDK uses ES modules. Make sure your project is configured for ESM: Option 1: Set "type": "module" in your package.json:
{
  "type": "module"
}
Option 2: Use .mts file extensions for TypeScript files. Option 3: Use a bundler (Vite, esbuild, tsup) that handles ESM resolution.

TypeScript

The SDK ships with built-in type declarations. No additional @types/ package is needed.
import Verial from '@verial-ai/sdk'
import type { Environment, Benchmark, Run, SimulatorType } from '@verial-ai/sdk'

const verial = new Verial({ apiKey: 'vk_xxx' })

const env: Environment = await verial.environments.create({
  name: 'Test Clinic',
})