Skip to content

About

TTSBridge is a standalone TikTok LIVE bridge that lets users log in once, saves the local browser session, then runs hidden/headless during streams. It captures TikTok LIVE WebSocket events and emits normalized localhost WebSocket JSON for chat, gifts, follows, likes, status, and diagnostics.

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

TTSBridge

TTSBridge is a standalone TikTok LIVE bridge for TTS Everything. It replaces the TikFinity dependency by logging into TikTok with a local browser profile, running TikTok LIVE capture hidden/headless, and emitting normalized localhost events.

It is not TikFinity and does not use TikTok-Live-Connector, @zerodytrash packages, TikTokLive, gotiktoklive, EulerStream, TikTokLiveSharp, TikTokLiveJava, or forks/ports/wrappers of those projects.

What It Does

  • Opens a visible browser only for one-time manual TikTok login.
  • Saves the TikTok browser session in %APPDATA%\TTS Everything\TTSBridge\profiles\tiktok.
  • Closes the login browser after login is verified.
  • Runs normal TikTok LIVE capture hidden/headless.
  • Captures TikTok LIVE WebSocket/Webcast frames without scraping rendered chat DOM.
  • Emits normalized chat, gift, follow, like, status, and system events over localhost WebSocket.
  • Keeps raw diagnostics off unless --save-raw is explicitly used.

Install And Build

npm.cmd install
npm.cmd run install:browsers
npm.cmd run verify
npm.cmd run build:exe

The Windows executable is created at:

dist\TTSBridge.exe

Commands

Run one-time TikTok login:

.\dist\TTSBridge.exe auth

Start hidden LIVE capture:

.\dist\TTSBridge.exe start --handle somecreator --port 21213

Run fake integration events:

.\dist\TTSBridge.exe fake --port 21213

Check saved-session status:

.\dist\TTSBridge.exe status

Delete only the saved TikTok browser profile:

.\dist\TTSBridge.exe logout

Run diagnostics:

.\dist\TTSBridge.exe diagnose --handle somecreator --port 21213 --save-raw

Raw diagnostics may include viewer usernames, chat messages, gift data, and profile image URLs. They never include browser profile contents, cookies, session tokens, or unredacted WebSocket URLs.

Localhost API

TTSBridge binds only to 127.0.0.1.

WebSocket endpoints:

ws://127.0.0.1:21213/
ws://127.0.0.1:21213/tiktok/events

HTTP endpoints:

GET /health
GET /status
GET /events/recent?limit=100
GET /stats
GET /diagnostics

/diagnostics is available only in diagnostics mode.

On WebSocket connection, TTSBridge immediately sends:

{
  "event": "system",
  "type": "connected",
  "source": "ttsbridge",
  "version": "0.1.4",
  "timestamp": 1710000000000
}

It then sends the current sanitized status event so clients that connect after startup can still initialize their TikTok connection UI.

Event Contract

All user-facing events include:

{
  "platform": "tiktok",
  "source": "ttsbridge",
  "timestamp": 1710000000000
}

Chat:

{
  "event": "chat",
  "type": "chat",
  "platform": "tiktok",
  "source": "ttsbridge",
  "id": "evt_...",
  "timestamp": 1710000000000,
  "user": {
    "id": null,
    "uniqueId": "viewer123",
    "nickname": "Viewer Name",
    "displayName": "Viewer Name",
    "avatarUrl": null
  },
  "message": "hello"
}

Gift:

{
  "event": "gift",
  "type": "gift",
  "platform": "tiktok",
  "source": "ttsbridge",
  "id": "evt_...",
  "timestamp": 1710000000000,
  "user": {
    "uniqueId": "viewer123",
    "displayName": "Viewer Name"
  },
  "gift": {
    "id": "5655",
    "name": "Rose",
    "repeatCount": 1,
    "diamondCount": 1,
    "repeatEnd": true
  }
}

Follow:

{
  "event": "follow",
  "type": "follow",
  "platform": "tiktok",
  "source": "ttsbridge",
  "id": "evt_...",
  "timestamp": 1710000000000,
  "user": {
    "uniqueId": "viewer123",
    "displayName": "Viewer Name"
  },
  "message": "Viewer Name followed the LIVE creator"
}

Like:

{
  "event": "like",
  "type": "like",
  "platform": "tiktok",
  "source": "ttsbridge",
  "id": "evt_...",
  "timestamp": 1710000000000,
  "user": {
    "uniqueId": "viewer123",
    "displayName": "Viewer Name"
  },
  "like": {
    "count": 1,
    "totalCount": 250
  }
}

Unknown/raw events are never shaped as chat, gift, follow, or like.

TTS Everything Integration

TTS Everything should:

  1. Bundle dist\TTSBridge.exe.
  2. Run TTSBridge.exe auth when the user clicks "Log in to TikTok."
  3. Run TTSBridge.exe start --handle <handle> --port 21213 when TikTok is enabled.
  4. Connect to ws://127.0.0.1:21213/.
  5. Route event: "chat" through existing TikTok chat handling.
  6. Route event: "gift" through existing Gifts/Donos handling.
  7. Route event: "follow" through follower alert/TTS handling if enabled.
  8. Route event: "like" through like alert/TTS handling if enabled.
  9. Stop the bridge process on app exit.

TTS Everything does not need to know about TikTok browser sessions, hidden Playwright capture, WebSocket frame capture, protobuf decoding, compression, cookies, or Webcast internals.

Runtime Data

Local runtime data is stored under:

%APPDATA%\TTS Everything\TTSBridge\

Runtime data includes:

profiles\tiktok\
logs\
diagnostics\
diagnostics\raw-frames\
settings.json

Do not commit runtime data. TTSBridge does not ask for TikTok credentials, does not collect passwords, and does not print cookies or session tokens.

Verification

npm.cmd run verify
.\dist\TTSBridge.exe fake --port 21213

In another terminal:

@'
const ws = new WebSocket("ws://127.0.0.1:21213/");
ws.addEventListener("message", e => console.log(e.data));
ws.addEventListener("error", e => console.error(e));
'@ | node -

Fake mode emits system, status, chat, gift, follow, and like events.

About

TTSBridge is a standalone TikTok LIVE bridge that lets users log in once, saves the local browser session, then runs hidden/headless during streams. It captures TikTok LIVE WebSocket events and emits normalized localhost WebSocket JSON for chat, gifts, follows, likes, status, and diagnostics.

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages