@slashmobility/livekit-components
v0.0.2
Published
<!--BEGIN_BANNER_IMAGE-->
Downloads
5
Readme
Use this SDK to add real-time video, audio and data features to your React app. By connecting to a self- or cloud-hosted LiveKit server, you can quickly build applications like interactive live streaming or video calls with just a few lines of code.
Quick Start
First add the library to your project:
npm i @slashmobility/livekit-components-react
Then use any of our pre-fabricated or helper components:
import { LiveKitRoom, VideoConference } from '@slashmobility/livekit-components-react';
const TOKEN = 'generated-jwt';
const WS_URL = 'wss://my-livekit-server';
export default function Example() {
return (
<LiveKitRoom token={TOKEN} serverUrl={WS_URL} connect={true}>
<VideoConference />
</LiveKitRoom>
);
}
Docs
For more information checkout the LiveKit Components Docs
Examples
There are some basic examples of how to use and customize LiveKit components in this mono repo. They are located in the nextjs examples folder /examples/nextjs
. In order to set the examples up locally follow the Development Setup.
We also have a fully featured video conferencing application built on top of LiveKit Components. Start a video conference at meet.livekit.io and take a look at the implementation in the livekit-examples/meet repo.
Development Setup
If you are interested in contributing to the project or running the examples that are part of this mono-repository, then you must first set up your development environment.
Setup Monorepo
This repo consists of multiple packages that partly build on top of each other. It relies on pnpm workspaces and Turborepo (which gets installed automatically).
Clone the repo and run pnpm install
the root level:
pnpm install
In order to link up initial dependencies and check whether everything has installed correctly run
pnpm build
This will build all the packages in /packages
and the examples in /examples
once.
After that you can use a more granular command to only rebuild the packages you are working on. E.g. to test and automatically rebuild package dependencies for the nextjs example, run:
pnpm dev:next
Note For the examples to work you'll need to make sure to copy the the contents of .env.example in the specific example folder to a newly created .env.local file and adjust the values accordingly to your livekit server setup.