@botdojo/sdk
v0.0.8
Published
Lightweight BotDojo SDK for running flows via API
Downloads
15
Readme
@botdojo/sdk
Run BotDojo AI flows with custom tools and real-time streaming.
Installation
npm install @botdojo/sdkQuick Start
Get your API key from https://docs.botdojo.com/docs/api →
import { BotDojoSDK } from '@botdojo/sdk';
const client = new BotDojoSDK({
apiKey: 'your-api-key'
});
const result = await client.runFlow(
{ text_input: 'Hello!' },
{
callbacks: {
onNewToken: (token) => {
if (token.token && token.streamToUser) {
process.stdout.write(token.token);
}
},
onStepUpdate: (step) => {
console.log(`Step: ${step.stepLabel} - ${step.stepStatus}`);
}
}
}
);Dynamic MCP & Custom Tools
Want to give your agents access to your application's live data and functions? See the Dynamic MCP Guide →
API Reference
Constructor
new BotDojoSDK({
apiKey: string // Your API key from app.botdojo.com
})runFlow()
await client.runFlow(
input: any, // Input data for your flow
options?: {
flowId?: string, // Optional: specific flow ID when using a Project API key
callbacks?: {
onNewToken?: (token) => void,
onStepUpdate?: (step) => void,
onFlowRequestStart?: (request) => void,
onFlowRequestEnd?: (request) => void
},
sessionId?: string // Resume a session
}
)Links
License
MIT
