TypeScript SDK
The official TypeScript SDK for Danube AI provides a fully-typed interface for accessing services, tools, workflows, skills, sites, and more through the Danube platform. Works with both TypeScript and JavaScript in Node.js environments.Installation
Quick Start
Authentication
The SDK uses your Danube API key for authentication. You can provide it in two ways:API Reference
Services
Tools
Skills
Identity
Workflows
Sites
Credentials
Wallet
Agents
Register autonomous agents with their own API keys and USDC wallets:Error Handling
The SDK provides specific error types for different error conditions:Error Types
| Error | Status Code | Description |
|---|---|---|
AuthenticationError | 401 | Invalid or missing API key |
AuthorizationError | 403 | Permission denied |
ConfigurationRequiredError | 403 | Service needs credential setup |
NotFoundError | 404 | Resource not found |
ValidationError | 400 | Invalid request parameters |
RateLimitError | 429 | Rate limit exceeded |
ExecutionError | 500 | Tool execution failure |
DanubeConnectionError | 503 | Cannot connect to API |
DanubeTimeoutError | 504 | Request timed out |
Configuration Options
| Parameter | Environment Variable | Default | Description |
|---|---|---|---|
apiKey | DANUBE_API_KEY | (required) | Your Danube API key |
baseUrl | DANUBE_API_URL | https://api.danubeai.com | API base URL |
timeout | DANUBE_TIMEOUT | 30 | Request timeout (seconds) |
maxRetries | DANUBE_MAX_RETRIES | 3 | Max retry attempts |
Models
Service
| Field | Type | Description |
|---|---|---|
id | string | Service UUID |
name | string | Service name |
description | string | Service description |
serviceType | string | "mcp_server", "api", "internal", or "website" |
toolCount | number | Number of available tools |
isConnected | boolean | Whether MCP service is connected |
Tool
| Field | Type | Description |
|---|---|---|
id | string | Tool UUID |
name | string | Tool name |
description | string | Tool description |
serviceId | string | Parent service ID |
parameters | object | Parameter definitions |
ToolResult
| Field | Type | Description |
|---|---|---|
success | boolean | Whether execution succeeded |
result | unknown | Execution result |
error | string | Error message (if failed) |
toolName | string | Name of executed tool |
durationMs | number | Execution time |
Workflow
| Field | Type | Description |
|---|---|---|
id | string | Workflow UUID |
name | string | Workflow name |
description | string | Workflow description |
stepCount | number | Number of steps |
visibility | string | "public" or "private" |
tags | string[] | Workflow tags |
totalExecutions | number | Total execution count |
WorkflowExecution
| Field | Type | Description |
|---|---|---|
id | string | Execution UUID |
workflowId | string | Parent workflow ID |
status | string | "pending", "running", "success", or "failed" |
inputs | object | Input values provided |
stepResults | WorkflowStepResult[] | Per-step results |
error | string | Error message (if failed) |
executionTimeMs | number | Total execution time |
AgentSite
| Field | Type | Description |
|---|---|---|
id | string | Site UUID |
domain | string | Site domain |
url | string | Full URL |
status | string | "pending", "crawling", "analyzed", or "live" |
components | SiteComponents | Structured site data (contact, pricing, docs, etc.) |
category | string | Site category |
tags | string[] | Site tags |
