@lyno/client-sdk
TypeScript icon, indicating that this package has built-in type declarations

2.10.5 • Public • Published

Lyno Client SDK

  • State saved in react context

  • SDK should be based on hooks and not provide any frontend code

  • TODO: how to disconnect (connected variable and execute leave method on hangup?)

  • Notification should include user avatar with fallback to favicon

  • disconnect and reconnect if token has changed and already connected

  • electron events on leave to trigger window closing

Install

npm install react react-redux redux @lyno/client-sdk
# or
yarn add react react-redux redux @lyno/client-sdk

Usage

import { useLyno, Track, LynoProvider } from '@lyno/client-sdk';

const MyClient = () => {
  const { connected, muted, setMuted, participants } = useLyno({
    endpoint: process.env.JITSI_HOSTNAME,
    token: 'hj85ingmg9950tjmmvdrpo90jgpo',
  });

  return connected ? (
    <div>
      {participants.map(({ avatar, tracks }) => (
        <>
          <image src={avatar} />
          {tracks.map((track) => <Track track={track} />)}
        </>
      ))}
      <button onClick={() => setMuted(!muted)}>
        {muted ? 'muted' : 'mute'}
      </button>
    </div>
  ): null;
};

const App = () => (
  <LynoProvider>
    <MyClient />
  </LynoProvider>
);

Readme

Keywords

none

Package Sidebar

Install

npm i @lyno/client-sdk

Weekly Downloads

0

Version

2.10.5

License

ISC

Unpacked Size

340 kB

Total Files

44

Last publish

Collaborators

  • gcascio
  • sapkra