रियलटाइम इवेंट
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.
| Room | Joined | Who |
|---|---|---|
| tenant:<tenantId> | Automatically at connect | Console connections |
| project:<projectId> | subscribe, authorized against the tenant | Console connections |
| conversation:<conversationId> | At handshake, via project key + conversation token | SDK messenger panels, this one room only |
Server events
| Event | Room | Fired when | Payload |
|---|---|---|---|
| flagChange | project | A flag is created, edited, archived or unarchived | projectId, key, archived |
| event.ingested | project | The ingest pipeline accepts a batch | events (the rendered batch) |
| workflow.run | project | A workflow run advances | runId, status, currentNodeId |
| conversation.turn | project and conversation | A conversation gains a turn | conversationId, turn |
| subscribed | the socket | A subscribe was accepted | projectId |
| unsubscribed | the socket | An unsubscribe completed | projectId |
| error | the socket | A subscribe was malformed, forbidden or hit a fault | message, projectId when relevant |
Client events
| Event | Payload | Effect |
|---|---|---|
| subscribe | projectId | Joins the project room after a tenant-ownership check |
| unsubscribe | projectId | Leaves the project room |