githubEdit

Browser SDK quickstart

This guide shows you how to use the Whereby Browser SDK to create a custom React video calling application with full control over the user interface. Unlike the web component approach, the Browser SDK provides granular access to video streams, participants, and room actions, enabling you to build completely tailored video experiences.

circle-info

The Browser SDK is ideal when you need to integrate video calling seamlessly into existing applications, implement custom layouts, or create specialized video experiences like telehealth platforms, virtual classrooms, or branded conference solutions.

Prerequisites

This guide assumes you have a React development environment set up and are familiar with React hooks and JSX syntax. You'll also need:

  • A Whereby Embedded account with an active subscription

  • A created meeting room with its URL

  • Node.js and npm or yarn installed

  • A React project (create one with Vitearrow-up-right, Parcelarrow-up-right, Create React App, or similar)

If you haven't created a Whereby embedded account and meeting room yet, follow the Whereby Embedded initial setup guide.

Getting Started

Install the SDK

Add the Whereby Browser SDK to your React project:

npm install @whereby.com/browser-sdk

For yarn users:

yarn add @whereby.com/browser-sdk

Basic Implementation

The Browser SDK centers around the useRoomConnection hook, which manages the connection to your Whereby room and provides access to participants, actions, and UI components.

  1. Import the necessary components:

  1. Set up the room connection:

  1. Render video streams:

  1. Add basic styles to make your video elements visible:

Adding Controls

Enhance your video app with camera and microphone controls:

Complete Example

Here's a fully functional video app that demonstrates the core Browser SDK features:

Note: Replace "https://your-subdomain.whereby.com/your-room-id" with your actual room URL from the Whereby dashboard.

Customizing Your App

The Browser SDK provides extensive customization options:

Advanced Features: Add screen sharing with startScreenshare() and stopScreenshare() actions, implement chat functionality using the chatMessages state and sendChatMessage() action, or handle room locks with the knock() action.

Custom Layouts: Create grid layouts, spotlight views, or presentation modes by manipulating how you render the VideoView components and applying custom CSS.

Event Handling: Access detailed room state including participant count, connection status, and media device states to build sophisticated UI logic.

Branding: Since you control the entire UI, you can implement your brand colors, logos, and styling without limitations.

See Also

Last updated

Was this helpful?