Getting started
Connect to a TikTok LIVE room, receive your first event, and choose the right reference for your application.
Choose your library
Start with the language your application already uses. Each library guide includes its runtime requirements, installation method, event API and configuration.
| Application | Starting points |
|---|---|
| Node.js services and TypeScript applications | JavaScript / TypeScript |
| Python applications and automation | Python |
| Native services and typed event processing | Rust, Go |
| .NET applications and Unity | C# |
| JVM applications | Java |
| Native Dart applications | Dart |
| OTP applications | Elixir |
| Game loops and native scripting | Lua |
| C applications and foreign-function interfaces | C / FFI |
| Command-line automation | PowerShell, Shell |
Run your first connection
- Install the library using its language guide. Some integrations use package registries; others use the public source directly.
- Replace
username_herein the quickstart with an account that is currently live. - Register event handlers before starting the connection.
- Run the example and send a chat message in the room to observe a chat event.
- Stop the client using the shutdown mechanism in the same guide.
The basic event connection obtains an anonymous ttwid cookie. You do not need a signing-service API key for that connection. A private session is a separate requirement for certain metadata calls, including the full audience roster.
Understand the session lifetime
Connection methods differ by language. In JavaScript, connect() resolves after the first successful WebSocket handshake and the event loop continues in the background. In Python, await client.connect() runs the session until it stops. Go returns an event channel; Rust returns an event stream after room resolution.
Use the connection lifecycle guide when integrating startup, reconnects and shutdown into an application.
Add room metadata when you need it
Room metadata is optional. Fetching the room title or stream URLs is separate from receiving LIVE events.
- Room info describes metadata and stream URL fields.
- Online audience describes the login-gated roster.
- TTWID authentication describes the anonymous WebSocket connection.
Read event data correctly
Use the fields documented for your language. Similar events may expose comment or content, and names may use snake_case or camelCase. Gift streak counters can be cumulative; a repeated message is not necessarily a new gift. Where available, use the library's gift-streak and like-accumulation helpers.
Find the next answer
- For an installation or coding example, open the relevant library guide.
- For a request method, parameter or response field, use the endpoint reference.
- For authentication or transport observations, use documented behaviors.
- For an empty response or a connection that will not stay up, use troubleshooting.