Aller au contenu principal

Temps réel

La surface Socket.IO diffuse les changements de drapeaux, les messages et les exécutions de workflow aux clients connectés. Une connexion non authentifiée est déconnectée immédiatement.

At a glance

Host
https://eu.ws.prodantix.com
Transport
Socket.IO
Auth
Access token on the handshake
Rooms
Tenant room automatically, project rooms via subscribe
Plain Text
https://eu.ws.prodantix.com

Authenticating the handshake

The token is read from handshake.auth.token, handshake.auth.authorization, or the Authorization header, whichever is present.

Rooms

A connection joins its tenant room automatically. Project rooms are opt-in through subscribe, and every join is authorized server-side against the projects the caller’s tenant owns.

Events

DirectionEventPayload
server → clientready{ tenantId }
client → serversubscribe{ projectId }
server → clientsubscribed{ projectId }
client → serverunsubscribe{ projectId }
server → clientunsubscribed{ projectId }
server → clienterror{ message }

Connecting

TypeScript
import { io } from 'socket.io-client';

const socket = io('https://eu.ws.prodantix.com', {
  auth: { token: accessToken },
});

socket.on('ready', ({ tenantId }) => {
  socket.emit('subscribe', { projectId });
});

socket.on('flagChange', payload => console.log(payload));