Connect with JWT
Use the official socket.io-client. Pass the access token in handshake.auth.token (query.token is also accepted). Invalid or expired tokens close the handshake with “Invalid or expired token”.
- URL: https://api.actiwapi.com (same host as the REST API, not /api).
- transports: websocket first, polling fallback.
- On success the server emits connected with { userId, tenantId, events }.
- The socket automatically joins tenant:{tenantId} and user:{userId}.