TikTok LIVE in the self-hosted version
This page is the technical reference. For the step-by-step guide (sign key, connecting, offline simulation and what each error means) see Go LIVE on TikTok.
The original app reached TikTok LIVE through the HypeMyStream cloud relay (live/tiktok-connector.ts). In local
mode the app connects from your computer instead, with live/tiktok-direct-connector.ts and the npm package
tiktok-live-connector. It emits the same events with the
same payloads as the relay did, so games, sounds, jumpscares, TTS, overlays and stats work unchanged:
| Event | Payload (see live/tiktok-direct-payloads.ts) |
|---|---|
gift |
giftId, giftName, giftType, repeatCount, repeatEnd (streakable gifts stay open until TikTok ends the combo), value (diamonds per gift), giftImageUrl, eventId, user |
like |
likeCount, roomTotal, eventId, user |
chat |
comment, atUser, mentioned, isFollower, isSubscriber, isModerator, fanClubLevel, eventId, user |
follow, share |
eventId, user |
join, viewers |
viewer joins and the viewer count (emitted, not used by the app yet) |
user is { id, handle, displayName, avatar, isModerator, isSubscriber, isFollower, fanClubLevel?, gifterLevel? }.
The fan club level comes from TikTok’s fan club data or the fan club badge (sceneType 10), the gifter level from
the pay grade or the level badge (sceneType 8). Chat that TikTok replays when a connection opens is dropped, so a
reconnect does not read old messages aloud again.
Sign key
TikTok’s LIVE connection has to be signed. tiktok-live-connector uses the Euler Stream
sign server for that. It works without a key on Euler Stream’s shared free limits. With your own free key you get
your own limits: paste it in Settings → TikTok LIVE → Euler Stream sign key. It is saved in
local-settings.json in the app’s user data folder (never in the repository), and only its last four characters are
shown in the window. The SIGN_API_KEY environment variable is used when no key is saved.
When TikTok or the sign server refuses, the connect error says why (not LIVE, user not found, rate limited, key not accepted, sign server error, timeout, no internet).
Offline simulation
Settings → TikTok LIVE → Offline simulation (or HMS_LIVE_SIMULATION=1) connects to nothing: going LIVE always
succeeds and only test events (window.api.injectTestLiveEvent) reach the games. Test events also work during a real
TikTok connection. npm run test:obs turns the simulation on for its checks and puts your setting back.
Library version
tiktok-live-connector is pinned to 2.4.0, the newest release under the MIT license (with its MIT dependencies
tiktok-live-proto 0.2.3 and tiktok-live-api-sdk). Releases from 2.4.1 on are licensed AGPL-3.0-only; moving to
one changes the license terms for distributed builds of the app.
With HMS_CLOUD=1 the original cloud relay connector is used, unchanged.