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:
javascriptconst ws = new WebSocket('wss://api.aiosdna.com/ws');
Authentication
Authenticate using JWT tokens:
javascriptws.onopen = () => {ws.send(JSON.stringify({type: 'auth',token: 'your-jwt-token'}));};
Event Types
Workflow Events
Subscribe to workflow execution events:
javascriptws.send(JSON.stringify({type: 'subscribe',channel: 'workflows',workflowId: 'workflow-123'}));
Kernel Events
Subscribe to kernel events:
javascriptws.send(JSON.stringify({type: 'subscribe',channel: 'kernels',kernelId: 'kernel-123'}));
Next Steps
- Learn about REST Endpoints
- Explore Authentication