Skip to main content
VertaaUX Docs
SDK

Installation

Install and configure the VertaaUX SDK for Node.js

Installation

Install the VertaaUX TypeScript SDK in your Node.js project.

Package Installation

npm install @vertaaux/sdk
yarn add @vertaaux/sdk
pnpm add @vertaaux/sdk

Requirements

RequirementVersionNotes
Node.js18+Required (uses native fetch)
TypeScript5.0+Optional, for type checking

Module Support

The SDK supports both ESM and CommonJS:

import { VertaaUX } from '@vertaaux/sdk';
const { VertaaUX } = require('@vertaaux/sdk');

Environment Setup

Get Your API Key

  1. Sign up at vertaaux.ai
  2. Navigate to Settings > API Keys
  3. Click Create API Key
  4. Copy the key (starts with vx_live_ or vx_test_)

Set Environment Variable

Add your API key to your environment:

# Add to ~/.bashrc, ~/.zshrc, or .env file
export VERTAA_API_KEY=vx_live_your_key_here
# PowerShell
$env:VERTAA_API_KEY = "vx_live_your_key_here"

# Or set permanently
[Environment]::SetEnvironmentVariable("VERTAA_API_KEY", "vx_live_your_key_here", "User")
.env
VERTAA_API_KEY=vx_live_your_key_here

Load with dotenv:

import 'dotenv/config';
import { VertaaUX } from '@vertaaux/sdk';

Security: Never commit API keys to version control. Add .env to your .gitignore.

Verify Installation

Create a test file to verify the SDK is working:

verify-sdk.ts
import { VertaaUX } from '@vertaaux/sdk';

const client = new VertaaUX({
  apiKey: process.env.VERTAA_API_KEY!,
});

// Check quota to verify authentication
async function verify() {
  try {
    const quota = await client.getQuota();
    console.log('SDK installed successfully!');
    console.log('Plan:', quota.plan);
    console.log('Credits remaining:', quota.credits_remaining);
  } catch (error) {
    console.error('Error:', error);
    process.exit(1);
  }
}

verify();

Run the verification:

npx tsx verify-sdk.ts

Expected output:

SDK installed successfully!
Plan: pro
Credits remaining: 766

TypeScript Configuration

For the best TypeScript experience, ensure your tsconfig.json includes:

tsconfig.json
{
  "compilerOptions": {
    "strict": true,
    "esModuleInterop": true,
    "moduleResolution": "node"
  }
}

The SDK includes complete type definitions, so no additional @types packages are needed.

Next Steps

Was this page helpful?

On this page