AIOS DNA

WebSocket Streams

Learn about WebSocket streams and real-time events

WebSocket Streams

AIOS DNA provides WebSocket streams for real-time data and events.

Connection

Connect to the WebSocket endpoint:

javascript
const ws = new WebSocket('wss://api.aiosdna.com/ws');

Authentication

Authenticate using JWT tokens:

javascript
ws.onopen = () => {
ws.send(JSON.stringify({
type: 'auth',
token: 'your-jwt-token'
}));
};

Event Types

Workflow Events

Subscribe to workflow execution events:

javascript
ws.send(JSON.stringify({
type: 'subscribe',
channel: 'workflows',
workflowId: 'workflow-123'
}));

Kernel Events

Subscribe to kernel events:

javascript
ws.send(JSON.stringify({
type: 'subscribe',
channel: 'kernels',
kernelId: 'kernel-123'
}));

Next Steps

Was this helpful?