Skip to main content
Connect via WebSocket for persistent bidirectional communication.

Connection

GET /ws?token={access_token}
const ws = new WebSocket(
  `wss://agent-{gateway-id}.noorle.com/ws?token=${token}`
);

ws.onopen = () => {
  // Send message
  ws.send(JSON.stringify({
    jsonrpc: "2.0",
    id: 1,
    method: "message/send",
    params: { message: "Hello" }
  }));
};

ws.onmessage = (event) => {
  const response = JSON.parse(event.data);
  console.log(response);
};

Benefits

  • Persistent connection
  • Lower latency
  • Streaming support
  • Keep-alive handling