DG Messenger Socket.IO | TTF Docs
Skip to main content
sdks

DG Messenger Socket.IO

Real-time Socket.IO connection setup and event flow for DG Messenger chat and WebRTC calls.

Connecting to Socket.IO

master-backend initializes a Socket.IO server alongside Express (socketHandler(io)). Connect from your web or React Native client using your trusted origin:

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

const socket = io('https://api.timetofuture.com', {
  withCredentials: true,
  transports: ['websocket', 'polling'],
});

socket.on('connect', () => {
  console.log('Connected to TTF Messenger:', socket.id);
});