Methods

Methods

Available Methods

You can install the Huddle01 Vanilla JS SDK packages in two ways:

  1. Using the script tag: Add the following code snippet to the head of your HTML.

    <script src="https://unpkg.com/@huddle01/web-core@umd/dist/index.global.js"></script>
     
    <script>
     
    let client;
     
    // call this function in onclick of `join room` button
    const init = async () => {
      client = new HuddleWebCore.HuddleClient({
        projectId: "YOUR_PROJECT_ID",
        options: {
          activeSpeakers: {
            // Number of active speaker visible in the grid, by default 8
            size: 10,
          },
        },
      });
      const room = await client.joinRoom({
        roomId: "YOUR_ROOM_ID",
        token: "YOUR_ACCESS_TOKEN",
      });
    };
    </script>
  2. Using npm or any other package manager: Run the following command in your terminal to install the package:

npm install @huddle01/web-core

Using client to access Methods

Once you initialise huddleClient you can access various methods such as joinRoom and other methods.

💡

You can generate Access Token using our Server SDK. To generate roomId you can use our Create Room API.

<script>
// Joining room
huddleClient.joinRoom({
	roomId: "YOUR_ROOM_ID",
	token: "YOUR_ACCESS_TOKEN"
});
 
// Listening to room joined event
huddleClient.room.on(eventName: "room-joined", () => {
	console.log("Room Joined");
}) 
</script>
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.