Giter Site home page Giter Site logo

lightder / components-js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from livekit/components-js

0.0 0.0 0.0 12.57 MB

Official open source React components and examples for building with LiveKit.

License: Apache License 2.0

JavaScript 1.56% TypeScript 94.39% SCSS 4.05%

components-js's Introduction

The LiveKit icon, the name of the repository and some sample code in the background.

LiveKit Components

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.



LiveKit Components Preview

Quick Start

First add the library to your project:

npm i @livekit/components-react

Then use any of our pre-fabricated or helper components:

import { LiveKitRoom, VideoConference } from '@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.

FAQ

Why is there a `@livekit/components-core` package? By abstracting most of the state handling logic into a common core we wanted to make sure that other framework implementations can be created with minimal code duplication. We chose observables as the main data structure for this core as its concepts translate really well to for example React's hooks, solid's signals, Svelte's stores, Vue's composables, and angular loves observables out of the box.
Did you consider using Custom Elements? Yes, we did consider building LK Components with custom elements (web components). We ultimately decided against it in order to give users the option to develop within the constraints of their chosen framework with all its specific concepts (e.g. in the case of react hooks, context etc.). That said the road towards supporting custom elements isn't entirely closed off. If the adoption of custom elements gains traction we can imagine providing a framework implementation that additionally compiles to custom elements (e.g. solid or svelte).
Will there be an implementation for my favorite framework? The highest priority is currently to get the core and react packages to a stable version that people love to work with. Once this is done we will decide on what other frameworks we might to support officially. If you want to develop an implementation for your favorite framework based on the core package we'd love to talk to you about it!

Monorepo Navigation


LiveKit Ecosystem
Real-time SDKsReact ComponentsJavaScriptiOS/macOSAndroidFlutterReact NativeRustPythonUnity (web)Unity (beta)
Server APIsNode.jsGolangRubyJava/KotlinPythonRustPHP (community)
Agents FrameworksPythonPlayground
ServicesLivekit serverEgressIngressSIP
ResourcesDocsExample appsCloudSelf-hostingCLI

components-js's People

Contributors

lukasio avatar ocupe avatar renovate[bot] avatar github-actions[bot] avatar mdo avatar davidzhao avatar cacheonly avatar mpnri avatar apurvbhavsar avatar dbkr avatar dnetteln avatar govind-io avatar harrisonlo avatar harrywebdev avatar nwang92 avatar paulwe avatar dsa avatar qraree avatar jmoguilevsky avatar richthegxd avatar hehehai avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    馃枛 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 馃搳馃搱馃帀

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google 鉂わ笍 Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.