WebSocket & Socket.IO API
If you want to build something of your own on top of TikTok Live events (a custom overlay, an integration with another device, or an internal tool), IndoFinity opens two local channels you can connect to.
Both endpoints run on localhost and are provided by the IndoFinity desktop app. Opening them from a browser won't work, because nothing is listening on that port.
Download the desktop app from the Download Application menu.
Two endpoints
| Channel | Endpoint |
|---|---|
| WebSocket | ws://localhost:62024 |
| Socket.IO | http://localhost:62025 |
Both send the same data, so pick whichever fits the tools you use. The online/offline status of each one shows directly in the WebSocket API menu in the dashboard.
Data format
Every message is JSON with the same structure:
{
"event": "chat",
"data": {}
}
| Key | Contents |
|---|---|
event | The TikTok event name, following the TikTok-Live-Connector documentation |
data | An object with that event's information, structured according to the event |
Donation events
Besides TikTok events, seven donation events are sent as well:
saweria · sociabuzz · trakteer · tako · bagibagi · sibagi · tiptap
Example: WebSocket
const ws = new WebSocket('ws://localhost:62024');
ws.onopen = function () {
console.log('Terhubung ke IndoFinity WebSocket');
};
ws.onmessage = function (data) {
try {
const message = JSON.parse(data.data);
const { event, data: eventData } = message;
console.log(`Event: ${event}`);
console.log('Data:', eventData);
if (event === 'chat') {
console.log(`@${eventData.uniqueId}: ${eventData.comment}`);
}
} catch (error) {
console.error('Error parsing message:', error);
}
};
ws.onclose = function () {
console.log('Koneksi WebSocket ditutup');
};
ws.onerror = function (err) {
console.error('WebSocket error:', err);
};
Example: Socket.IO
Add the client library first:
<script src="https://cdn.socket.io/4.7.5/socket.io.min.js"></script>
Or through Node.js:
npm install socket.io-client
Then:
import io from "socket.io-client";
const socket = io('http://localhost:62025');
socket.on('connect', () => {
console.log('Terhubung ke IndoFinity Socket IO');
});
socket.on('message', (data) => {
try {
const { event, data: eventData } = data;
console.log(`Event: ${event}`);
console.log('Data:', eventData);
if (event === 'chat') {
console.log(`@${eventData.uniqueId}: ${eventData.comment}`);
}
} catch (error) {
console.error('Error parsing message:', error);
}
});
The WebSocket API menu in the dashboard has a simulator panel above its documentation. You can fire every event type from there and watch it arrive in your app without going live at all.
This is the fastest way to confirm your connection works before you rely on it during a live.
Common problems
Symptom: the connection is refused. The IndoFinity desktop app isn't running, or you're trying from a browser. Check the Online/Offline status in the WebSocket API menu.
Symptom: connected, but no data comes in. Your TikTok live isn't connected yet. This connection forwards the events IndoFinity receives, so if nothing comes in, nothing gets forwarded. Use the simulator panel to check that the channel itself is healthy.
Symptom: event names aren't recognized. Event names follow TikTok-Live-Connector, not IndoFinity's naming. See the documentation linked above.