Requirements
- Node.js 18 or later
- TypeScript 5.0 or later (recommended)
- The SDK is ESM-only. CommonJS (
require()) is not supported.
Install
Configure
Create a client instance with your API key:Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
apiKey | string | Required | Your Verial API key (starts with vk_) |
baseUrl | string | https://api.verial.ai | API base URL (override for self-hosted or staging) |
timeout | number | 30000 | Request timeout in milliseconds |
maxRetries | number | 2 | Number of automatic retries on failure |
Custom Base URL
For development or self-hosted deployments:ESM Configuration
The SDK uses ES modules. Make sure your project is configured for ESM: Option 1: Set"type": "module" in your package.json:
.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.