Skip to content

TikTokLiveConnection

Defined in: src/lib/client/index.ts:43

new TikTokLiveConnection(uniqueId, options?): TikTokLiveConnection

Defined in: src/lib/client/index.ts:76

Create a new TikTokLiveConnection instance.

string

TikTok username (with or without leading @, or a full https://www.tiktok.com/@user/live URL).

Partial<object & object & object> & object & object | Partial<object & object & object> & object & object | Partial<object & object & object> & object & object | never | Partial<object & object & object> & object & object | Partial<object & object & object> & object & object | never | Partial<object & object & object> & object & object | Partial<object & object & object> & object & object = {}

Optional connection options.

Partial<object & object & object> & object & object


Partial<object & object & object> & object & object


Partial<object & object & object> & object & object


never


Partial<object & object & object> & object & object


Partial<object & object & object> & object & object


never


Partial<object & object & object> & object & object


Partial<object & object & object> & object & object

TikTokLiveConnection

(EventEmitter as WebcastTypedClient).constructor

readonly options: TikTokLiveConnectionMutableOptions

Defined in: src/lib/client/index.ts:46


readonly uniqueId: string

Defined in: src/lib/client/index.ts:77

TikTok username (with or without leading @, or a full https://www.tiktok.com/@user/live URL).

get apiClient(): EulerStreamApiClient

Defined in: src/lib/client/index.ts:145

Get an instance of the underlying API Client

EulerStreamApiClient


get availableGifts(): any

Defined in: src/lib/client/index.ts:181

Get the available gifts

any


get clientParams(): Record<string, string>

Defined in: src/lib/client/index.ts:202

Get the current client parameters

Record<string, string>


get isConnected(): boolean

Defined in: src/lib/client/index.ts:195

Check if the connection is established

boolean


get isConnecting(): boolean

Defined in: src/lib/client/index.ts:188

Get the current connection state

boolean


get roomId(): string

Defined in: src/lib/client/index.ts:209

Get the current room ID

string


get roomInfo(): any

Defined in: src/lib/client/index.ts:174

Get the current Room Info

any


get state(): TikTokLiveConnectionState

Defined in: src/lib/client/index.ts:218

Get the current connection state including the cached room info and all available gifts (if enableExtendedGiftInfo option enabled)

TikTokLiveConnectionState


get webClient(): WebcastHttpClient

Defined in: src/lib/client/index.ts:138

Get the current Web Client instance

WebcastHttpClient


get wsClient(): WebcastWebSocketClient | null

Defined in: src/lib/client/index.ts:152

Get the current WebSocket client instance. Will be null if not connected.

WebcastWebSocketClient | null

connect(roomId?): Promise<TikTokLiveConnectionState>

Defined in: src/lib/client/index.ts:234

Connects to the live stream of the specified streamer

string

Room ID to connect to. If not specified, the room ID will be retrieved from the TikTok API

Promise<TikTokLiveConnectionState>

The current connection state


disconnect(): Promise<void>

Defined in: src/lib/client/index.ts:369

Disconnects the connection to the live stream

Promise<void>


fetchAvailableGifts(): Promise<any>

Defined in: src/lib/client/index.ts:440

Get the available gifts in the current room

Promise<any>

Promise that will be resolved when the available gifts have been retrieved from the API


fetchIsLive(uniqueId?): Promise<boolean>

Defined in: src/lib/client/index.ts:410

Fetch whether the streamer is currently live

string = ...

Promise<boolean>


fetchRoomId(uniqueId?): Promise<string>

Defined in: src/lib/client/index.ts:395

Fetch the room ID from the TikTok API

string = ...

Optional unique ID to use instead of the current one

Promise<string>


fetchRoomInfo(roomId?): Promise<any>

Defined in: src/lib/client/index.ts:425

Get the current room info (including streamer info, room status and statistics)

string = ...

Promise<any>

Promise that will be resolved when the room info has been retrieved from the API


sendMessage(content, roomId?): Promise<WebcastRoomChatRouteResponse>

Defined in: src/lib/client/index.ts:456

Send a message to a TikTok LIVE Room

string

Message content to send to the stream

string = ...

Target room ID. If not specified, the message will be sent to the currently connected room. Note that a room ID is required to send a message, so if you’re not currently connected to a room you must specify a room ID.

Promise<WebcastRoomChatRouteResponse>


waitUntilLive(seconds?, abortSignal?): Promise<void>

Defined in: src/lib/client/index.ts:708

Wait until the streamer is live

number = 60

Number of seconds to wait before checking if the streamer is live again

AbortSignal

Process will keep checking if the streamer is live every seconds seconds until the streamer is live or the abort signal is triggered

Promise<void>