Skip to main content
The TaskForceAI TypeScript SDK provides a type-safe way to interact with our platform from Node.js or browser environments.

Installation

npm install taskforceai-sdk
# or
bun add taskforceai-sdk

Quick Start

import { TaskForceAI } from 'taskforceai-sdk';

const client = new TaskForceAI({
  apiKey: 'your-api-key',
});

// Run a task and wait for the result
const result = await client.runTask('Analyze this repository');
console.log(result.result);

Streaming Results

For long-running tasks, you can stream status updates in real-time.
const stream = client.runTaskStream('Complex analysis task');

for await (const status of stream) {
  console.log(`${status.status}: ${status.result ?? '...'}`);
}

Configuration

OptionTypeDescription
apiKeystringYour TaskForceAI API key (required)
baseURLstringCustom API endpoint URL
timeoutnumberRequest timeout in milliseconds
mockModebooleanEnable mock mode for local development