(room)
Operations related to rooms api
create- Create a room⚠️ Deprecatedget- Retrieve a room⚠️ Deprecateddelete- Delete a room⚠️ DeprecatedstartEgress- Start room RTMP egress⚠️ DeprecatedstopEgress- Stop room RTMP egress⚠️ DeprecatedcreateUser- Create a room user⚠️ DeprecatedgetUser- Get user details⚠️ DeprecatedupdateUser- Update a room user⚠️ DeprecateddeleteUser- Remove a user from the room⚠️ Deprecated
Create a multiparticipant livestreaming room.
⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.
import { Livepeer } from "livepeer";
const livepeer = new Livepeer({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await livepeer.room.create();
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { LivepeerCore } from "livepeer/core.js";
import { roomCreate } from "livepeer/funcs/roomCreate.js";
// Use `LivepeerCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const livepeer = new LivepeerCore({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await roomCreate(livepeer);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.CreateRoomResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Retrieve a room
⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.
import { Livepeer } from "livepeer";
const livepeer = new Livepeer({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await livepeer.room.get("<id>");
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { LivepeerCore } from "livepeer/core.js";
import { roomGet } from "livepeer/funcs/roomGet.js";
// Use `LivepeerCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const livepeer = new LivepeerCore({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await roomGet(livepeer, "<id>");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
id |
string | ✔️ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.GetRoomResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Delete a room
⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.
import { Livepeer } from "livepeer";
const livepeer = new Livepeer({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await livepeer.room.delete("<id>");
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { LivepeerCore } from "livepeer/core.js";
import { roomDelete } from "livepeer/funcs/roomDelete.js";
// Use `LivepeerCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const livepeer = new LivepeerCore({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await roomDelete(livepeer, "<id>");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
id |
string | ✔️ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.DeleteRoomResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Create a livestream for your room. This allows you to leverage livestreaming features like recording and HLS output.
⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.
import { Livepeer } from "livepeer";
const livepeer = new Livepeer({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await livepeer.room.startEgress("<id>", {
streamId: "aac12556-4d65-4d34-9fb6-d1f0985eb0a9",
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { LivepeerCore } from "livepeer/core.js";
import { roomStartEgress } from "livepeer/funcs/roomStartEgress.js";
// Use `LivepeerCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const livepeer = new LivepeerCore({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await roomStartEgress(livepeer, "<id>", {
streamId: "aac12556-4d65-4d34-9fb6-d1f0985eb0a9",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
id |
string | ✔️ | N/A |
roomEgressPayload |
components.RoomEgressPayload | ✔️ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.StartRoomEgressResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Stop room RTMP egress
⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.
import { Livepeer } from "livepeer";
const livepeer = new Livepeer({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await livepeer.room.stopEgress("<id>");
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { LivepeerCore } from "livepeer/core.js";
import { roomStopEgress } from "livepeer/funcs/roomStopEgress.js";
// Use `LivepeerCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const livepeer = new LivepeerCore({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await roomStopEgress(livepeer, "<id>");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
id |
string | ✔️ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.StopRoomEgressResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Call this endpoint to add a user to a room, specifying a display name at a minimum. The response will contain a joining URL for Livepeer's default meeting app. Alternatively the joining token can be used with a custom app.
⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.
import { Livepeer } from "livepeer";
const livepeer = new Livepeer({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await livepeer.room.createUser("<id>", {
name: "name",
canPublish: true,
canPublishData: true,
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { LivepeerCore } from "livepeer/core.js";
import { roomCreateUser } from "livepeer/funcs/roomCreateUser.js";
// Use `LivepeerCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const livepeer = new LivepeerCore({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await roomCreateUser(livepeer, "<id>", {
name: "name",
canPublish: true,
canPublishData: true,
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
id |
string | ✔️ | N/A |
roomUserPayload |
components.RoomUserPayload | ✔️ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.CreateRoomUserResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Get user details
⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.
import { Livepeer } from "livepeer";
const livepeer = new Livepeer({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await livepeer.room.getUser("<id>", "<value>");
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { LivepeerCore } from "livepeer/core.js";
import { roomGetUser } from "livepeer/funcs/roomGetUser.js";
// Use `LivepeerCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const livepeer = new LivepeerCore({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await roomGetUser(livepeer, "<id>", "<value>");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
id |
string | ✔️ | N/A |
userId |
string | ✔️ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.GetRoomUserResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Update properties for a user.
⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.
import { Livepeer } from "livepeer";
const livepeer = new Livepeer({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await livepeer.room.updateUser("<id>", "<value>", {
canPublish: true,
canPublishData: true,
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { LivepeerCore } from "livepeer/core.js";
import { roomUpdateUser } from "livepeer/funcs/roomUpdateUser.js";
// Use `LivepeerCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const livepeer = new LivepeerCore({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await roomUpdateUser(livepeer, "<id>", "<value>", {
canPublish: true,
canPublishData: true,
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
id |
string | ✔️ | N/A |
userId |
string | ✔️ | N/A |
roomUserUpdatePayload |
components.RoomUserUpdatePayload | ✔️ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.UpdateRoomUserResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Remove a user from the room
⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.
import { Livepeer } from "livepeer";
const livepeer = new Livepeer({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await livepeer.room.deleteUser("<id>", "<value>");
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { LivepeerCore } from "livepeer/core.js";
import { roomDeleteUser } from "livepeer/funcs/roomDeleteUser.js";
// Use `LivepeerCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const livepeer = new LivepeerCore({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await roomDeleteUser(livepeer, "<id>", "<value>");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
id |
string | ✔️ | N/A |
userId |
string | ✔️ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.DeleteRoomUserResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |