API ReferenceJavaScript APIonTikTokLiveEvent()

onTikTokLiveEvent

Signature

function onTikTokLiveEvent(callback: (event: TikTokLiveEvent) => void): () => void

Parameters

NameTypeDescription
callback(event: TikTokLiveEvent) => voidFunction called with a TikTokLiveEvent.

Returns

() => void

Usage

const unsubscribe = onTikTokLiveEvent((event) => {
  console.log(event.type, event.data);
});