Live Stream

Host your events virtually and see community interaction as it happens.

Create a stream

To create a stream, follow the code below. This will return an instance of the created Stream.

Note that the TypeScript SDK does not support broadcasting a live stream directly. Instead, it allows the creation of a stream object. You can then retrieve the streaming URL from this object and implement it with a third-party library or a streaming tool like OBS.

Enable live chat channel and reaction in a stream

The livestream chat and reaction features are enabled by setting the channelEnabled field when creating a stream object. These features are supported only for livestream posts created within a community.

After creating a stream post, the stream object will include the following properties to indicate related information:

{
  ...
  referenceId: 'postId',
  referenceType: 'post',
  targetId: 'communityId',
  targetType: 'community',
  postId: 'postId',
  channelId: 'channelId',
  channelEnabled: true,
  ...
}

Note: When getLiveChat() is called on the streamer side, the SDK creates a new live chat channel linked to the stream if one does not already exist. On the viewer side, calling getLiveChat() returns the live chat channel object only if it has already been created.

Delete a stream

To delete a stream, you will need the ID of the stream that you want to delete. The function will return true if successfully deleted, otherwise, it will throw an error.

Dispose a stream

Disposing a stream means updating the streaming status to ended and invalidating the streaming URL.

To dispose a stream, you need the ID of the stream that you want to dispose. The function will return true if successfully deleted, otherwise, it will throw an error.

Last updated

Was this helpful?