Get lives¶
This function get all lives that belongs the organization configured in passed token when the object is initialized. The example code below show how to use it:
import { Metalives } from "metalives-sdk"
import dotenv from 'dotenv'
dotenv.config();
const client = new Metalives(process.env.SDK_TOKEN);
const allLives = await client.live.getLives();
It'll return a list of lives and each of them is on the following format:
{
id: 'id of live',
startsAt: 'start time of live',
streamKey: 'stream key used to stream the live by rtmp server',
uriAlias: 'Live alias used in url',
streamUrl: 'Link to rtmp video stream',
recordingUrl: 'Link to recorded video',
visibility: 'Visibility of live',
chatEnabled: 'True if chat is enabeled in live, false otherwise',
status: 'Status of live',
title: 'Live title',
description: 'Live description',
thumbImg: 'Thumb image of live',
coverImgUrl: 'Cover image of live',
createdAt: 'Timestamp of live creation',
updatedAt: 'Timestamp of live update',
organizationId: 'Organization Id that this live belongs',
products: [
{
id: 'Product id',
name: 'Product name',
url: 'Link to product in original site',
price: 'Real price of the product',
originalPrice: 'Original price of the product',
imageUrl: 'Link to product image',
ref: 'Product reference in Marketplace',
createdAt: 'Timestamp when was created',
updatedAt: 'Timestamp when was updated last time',
storeId: 'id of product in store'
}
]
}