Quick Start
Get up and running with the Cadra SDK in under 5 minutes.
1. Install
bash
npm install @cadraos/sdk2. Create a Client
typescript
import { CadraClient } from '@cadraos/sdk';
const client = new CadraClient({
apiKey: 'sk-cad-xxxxxxxxxxxx',
orgId: 123,
});3. Execute an Agent
Synchronous — waits for completion
const result = await client.agents.executeSync('agent-uuid', {
task: 'What are the top 3 action items from yesterday\'s meeting?',
});
console.log(result.output);
// → "1. Follow up with design team on mockups..."4. Stream a Response
Real-time streaming
const stream = await client.agents.stream('agent-uuid', {
task: 'Write a blog post about AI trends',
});
stream.on('textDelta', ({ delta }) => process.stdout.write(delta));
stream.on('toolCall', ({ toolName }) => console.log('Tool:', toolName));
stream.on('complete', ({ execution }) => console.log('\nDone!'));
await stream.connect();5. Embed a Chat UI
React component
import { AgentChat, ChatConfigProvider } from '@cadraos/sdk/chat';
function App() {
return (
<ChatConfigProvider config={{
baseUrl: 'https://your-api.example.com/v1',
apiKey: 'sk-cad-xxxxxxxx',
orgId: 123,
}}>
<AgentChat
agentId="agent-uuid"
maxHeight="600px"
enableAttachments
/>
</ChatConfigProvider>
);
}Next Steps
- Chat UI Guide — Build a full chat interface with customization
- Streaming Guide — Deep dive into real-time streaming events
- File Attachments — Upload files and images to agent conversations
- API Reference — Full client documentation