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.
import { DanubeClient } from 'danube';// Initialize with API key (or set DANUBE_API_KEY environment variable)const client = new DanubeClient({ apiKey: 'dk_...' });// List available servicesconst services = await client.services.list({ limit: 5 });for (const service of services) { console.log(`${service.name}: ${service.toolCount} tools`);}// Search for toolsconst tools = await client.tools.search('send email');// Execute a toolconst result = await client.tools.execute({ toolName: 'Gmail - Send Email', parameters: { to: 'user@example.com', subject: 'Hello from Danube!', },});if (result.success) { console.log(result.result);} else { console.log(`Error: ${result.error}`);}// Clean up when doneclient.close();
The SDK uses your Danube API key for authentication. You can provide it in two ways:
// Set DANUBE_API_KEY in your environment// export DANUBE_API_KEY=dk_your_api_keyimport { DanubeClient } from 'danube';const client = new DanubeClient(); // Uses DANUBE_API_KEY automatically
// List/search servicesconst services = await client.services.list({ query: 'github', limit: 10 });// Get a specific serviceconst service = await client.services.get('service-uuid');// Get tools for a serviceconst result = await client.services.getTools('service-uuid');if (result.needsConfiguration) { console.log('Service needs credential configuration');} else { for (const tool of result.tools) { console.log(tool.name); }}
// Get user identityconst identity = await client.identity.get();console.log(`Profile: ${JSON.stringify(identity.profile)}`);console.log(`Contacts: ${identity.contacts.length}`);
// Search the agent-friendly site directoryconst sites = await client.sites.search({ query: 'payments', limit: 10 });// Get a site by IDconst site = await client.sites.get('site-uuid');console.log(`${site.domain}: ${site.status}`);// Get a site by domainconst site = await client.sites.getByDomain('stripe.com');if (site.components.pricing) { console.log(`Pricing: ${JSON.stringify(site.components.pricing)}`);}
// Store a credential for a serviceconst stored = await client.credentials.store({ serviceId: 'service-uuid', credentialType: 'api_key', credentialValue: 'sk-...',});console.log(`Stored for ${stored.serviceName}: ${stored.success}`);