Skip to main content

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:
Get your API key from the Danube Dashboard.

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

ErrorStatus CodeDescription
AuthenticationError401Invalid or missing API key
AuthorizationError403Permission denied
ConfigurationRequiredError403Service needs credential setup
NotFoundError404Resource not found
ValidationError400Invalid request parameters
RateLimitError429Rate limit exceeded
ExecutionError500Tool execution failure
DanubeConnectionError503Cannot connect to API
DanubeTimeoutError504Request timed out

Configuration Options

ParameterEnvironment VariableDefaultDescription
apiKeyDANUBE_API_KEY(required)Your Danube API key
baseUrlDANUBE_API_URLhttps://api.danubeai.comAPI base URL
timeoutDANUBE_TIMEOUT30Request timeout (seconds)
maxRetriesDANUBE_MAX_RETRIES3Max retry attempts
The SDK automatically retries failed requests with exponential backoff on rate limits (429) and server errors (502, 503, 504).

Models

Service

FieldTypeDescription
idstringService UUID
namestringService name
descriptionstringService description
serviceTypestring"mcp_server", "api", "internal", or "website"
toolCountnumberNumber of available tools
isConnectedbooleanWhether MCP service is connected

Tool

FieldTypeDescription
idstringTool UUID
namestringTool name
descriptionstringTool description
serviceIdstringParent service ID
parametersobjectParameter definitions

ToolResult

FieldTypeDescription
successbooleanWhether execution succeeded
resultunknownExecution result
errorstringError message (if failed)
toolNamestringName of executed tool
durationMsnumberExecution time

Workflow

FieldTypeDescription
idstringWorkflow UUID
namestringWorkflow name
descriptionstringWorkflow description
stepCountnumberNumber of steps
visibilitystring"public" or "private"
tagsstring[]Workflow tags
totalExecutionsnumberTotal execution count

WorkflowExecution

FieldTypeDescription
idstringExecution UUID
workflowIdstringParent workflow ID
statusstring"pending", "running", "success", or "failed"
inputsobjectInput values provided
stepResultsWorkflowStepResult[]Per-step results
errorstringError message (if failed)
executionTimeMsnumberTotal execution time

AgentSite

FieldTypeDescription
idstringSite UUID
domainstringSite domain
urlstringFull URL
statusstring"pending", "crawling", "analyzed", or "live"
componentsSiteComponentsStructured site data (contact, pricing, docs, etc.)
categorystringSite category
tagsstring[]Site tags

Source Code

The SDK is open source and available on GitHub: