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/sdkyarn add @vertaaux/sdkpnpm add @vertaaux/sdkRequirements
| Requirement | Version | Notes |
|---|---|---|
| Node.js | 18+ | Required (uses native fetch) |
| TypeScript | 5.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
- Sign up at vertaaux.ai
- Navigate to Settings > API Keys
- Click Create API Key
- Copy the key (starts with
vx_live_orvx_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")VERTAA_API_KEY=vx_live_your_key_hereLoad 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:
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.tsExpected output:
SDK installed successfully!
Plan: pro
Credits remaining: 766TypeScript Configuration
For the best TypeScript experience, ensure your tsconfig.json includes:
{
"compilerOptions": {
"strict": true,
"esModuleInterop": true,
"moduleResolution": "node"
}
}The SDK includes complete type definitions, so no additional @types packages are needed.
Next Steps
- Quickstart - Create your first audit
- Client Setup - Configuration options
- TypeScript Types - Type reference
Related
- API Authentication - How API keys work
- CLI Installation - Command-line alternative
Was this page helpful?