Get Rooms

getRooms() method will return all the rooms created from a given API_KEY.

import { API } from '@huddle01/server-sdk/api';
 
const rooms = async () => {
  const api = new API({
    apiKey: process.env.API_KEY!,
  });
 
  const rooms = await api.getRooms();
 
  return rooms;
};

Returns

getRooms() method returns an array of rooms with following fields.

NameTypeDescription
pageSizenumberThe number of rooms in current page
nextCursornumberThe cursor to fetch the next page of rooms.
prevCursornumberThe cursor to fetch the previous page of rooms.
countnumberThe total number of rooms.
roomsrooms[]An array of rooms
roomIdstringThe unique identifier of the room.
createdAtnumberThe creation time of the room in timestamp epoch format.
roomLockedbooleanState indicating if room is locked
metadatastringThe metadata associated with the room
{
  "rooms": [
      {
          "roomId": "dummy-room-id",
          "createdAt": "2024-08-06T06:42:06.356Z",
          "roomLocked": false,
          "metadata": null
      }
  ],
  "pageSize": 1,
  "current": 1,
  "nextCursor": 2,
  "prevCursor": 0,
  "count": 104
}
Audio/Video Infrastructure designed for developers to empower them to ship simple yet powerful Audio/Video Apps.
support
company
Copyright © 2024 Graphene 01, Inc. All Rights Reserved.