Quickstart
This guide will help you to quickly get started with using our Javascript SDK in your project.
Installation
You can install the Huddle01 Vanilla JS SDK packages in two ways:
-
Using the script tag: Add the following code snippet to the head of your HTML.
<script src="https://unpkg.com/@huddle01/web-core@latest/dist/index.js" /> <script type="module"> // Initialize huddleClient const huddleClient = new HuddleClient({ projectId: "YOUR_PROJECT_ID" }); </script>
-
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.
<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>