npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@100mslive/react-sdk

v0.10.10

Published

This package is a react wrapper over the core SDK(`@100mslive/hms-video-store`). An easy way to use the store, actions and notifications are provided via React hooks. Some other hooks are also provided for ease of use which wrap over the primitive ones.

Downloads

82,229

Readme

About

This package is a react wrapper over the core SDK(@100mslive/hms-video-store). An easy way to use the store, actions and notifications are provided via React hooks. Some other hooks are also provided for ease of use which wrap over the primitive ones. If someone is using class based react components, they'll be better off with using the core sdk directly.

Installation

// npm
npm install @100mslive/react-sdk@latest --save

// yarn
yarn add @100mslive/react-sdk@latest

Usage

Add HMSRoomProvider from @100mslive/react-sdk at the top level of your component tree where you want to use the hooks. Wihout this the hooks will throw an error.

<HMSRoomProvider>
   <YourComponent></YourComponent>
</HMSRoomProvider>

By default, when using HMSRoomProvider room leave will be called when you are leaving/closing the tab. To disable this behaviour, you can pass leaveOnUnload as false

NOTE: The above leave might or might not be successfully sent to server as it depends on the browser implementation. This works on chromium based browsers.

Primitive Hooks

These are hooks wrapper over the sdk things.

  • useHMSStore - to get any state from store
  • useHMSActions - hmsActions to perform any actions
  • useHMSNotifications - to receive any new notifications/error for the room
  • useHMSVanillaStore - return the store object directly to be used in non react context
  • useHMSStatsStore - to get webrtc related stats

Helpful Hooks

  • useVideo - attaching and detaching video based on trackId
  • useVideoList - helpful to build a paginated gallery view of video tiles
  • useScreenShare - to toggle screenshare
  • useCustomEvent - to add custom events
  • useDevices - returns a list of all A/V devices
  • useParticipants - get count of participants, participants filtered by role or metadata
  • usePreviewJoin - implementing preview + join
  • useAVToggle - to toggle mute/unmute for audio and video
  • useRemoteAVToggle - to toggle remote mute/unmute + audio volume changer on tile level
  • useAutoplayError - unblock browser autoplay block
  • useAudioLevelStyles - apply css properties on element based on it's audio level

Refer to docs for a more detailed guide.