Skip to main content

JavaScript & TypeScript SDK

Use @upon-ai/sdk to call the UponAI public API from Node.js. Requires Node.js 22.14 or later. Licensed under MIT by UponAI.

Install​

npm install @upon-ai/sdk@0.1.8

Create a customer API token in your dashboard profile and provide it to your server as UPONAI_API_KEY. Keep it out of browser bundles and source control.

Make your first request​

import { UponAI } from '@upon-ai/sdk';

const client = new UponAI({ apiKey: process.env.UPONAI_API_KEY! });
const workspaces = await client.listWorkspaces();
console.log(workspaces);

// Replace 123 with a workspace ID returned above.
const agents = await client.listAgents({
query: { workspaceId: 123, limit: 20 },
});
console.log(agents);

The client provides typed methods for 133 approved public operations, including live call monitoring and voice simulation projects, sessions and improvement runs. Inputs use path, query, and body groups matching the API reference. Each interactive API page includes a TypeScript SDK example that follows your request fields.

Handle errors and cancellation​

import { UponAIError } from '@upon-ai/sdk';

try {
await client.getAgent(
{ path: { agentId: 'agent_example' }, query: { workspaceId: 123 } },
{ timeoutMs: 15_000 },
);
} catch (error) {
if (error instanceof UponAIError) {
console.error(error.status, error.requestId);
}
}

Requests time out after 30 seconds by default. GET requests retry selected transient HTTP failures up to twice; writes are never automatically retried. An AbortSignal can be passed as signal in the second argument. Multipart operations accept native FormData; binary operations return Blob.

Package on npm · Source and examples

Version 0.1.5 adds browser-call transport and iceServers connection settings. The optional onResponse callback receives safe pagination metadata (hasMore and paginationKey); paginator next callbacks receive it as their third argument. Existing two-argument callbacks and flow-list arrays remain supported.

Version 0.1.6 adds voice and chat environment tags and 14 workspace integration operations, including connection management and CRM sync configuration.

Search documentation

Type to filter pages. Use ↑ ↓ to choose, then Enter to open.

0 matching pages
AI questions are sent only when you select Ask AI or press Enter on it. Don’t include API keys or customer data.