Перейти к основному содержимому

События в реальном времени

Полная карта поверхности Socket.IO: комнаты, события сервера и события клиента, взятые прямо из исходников сервера.

TypeScript
// Console: a JWT, in auth.token or the Authorization header
const socket = io('https://eu.ws.prodantix.com', {
  auth: { token: accessToken },
});

// SDK messenger panel: project key + conversation token, one room only
const panel = io('https://eu.ws.prodantix.com', {
  auth: { projectKey, conversationToken },
});

Rooms

An unauthenticated connection is disconnected immediately, with no error frame. A messenger panel is joined to exactly one conversation room and can never subscribe to a project room: a project frame stream is every thread in the project.

RoomJoinedWho
tenant:<tenantId>Automatically at connectConsole connections
project:<projectId>subscribe, authorized against the tenantConsole connections
conversation:<conversationId>At handshake, via project key + conversation tokenSDK messenger panels, this one room only

Server events

EventRoomFired whenPayload
flagChangeprojectA flag is created, edited, archived or unarchivedprojectId, key, archived
event.ingestedprojectThe ingest pipeline accepts a batchevents (the rendered batch)
workflow.runprojectA workflow run advancesrunId, status, currentNodeId
conversation.turnproject and conversationA conversation gains a turnconversationId, turn
subscribedthe socketA subscribe was acceptedprojectId
unsubscribedthe socketAn unsubscribe completedprojectId
errorthe socketA subscribe was malformed, forbidden or hit a faultmessage, projectId when relevant

Client events

EventPayloadEffect
subscribeprojectIdJoins the project room after a tenant-ownership check
unsubscribeprojectIdLeaves the project room