Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@100mslive/hms-video-store
Advanced tools
@100mslive Core SDK which abstracts the complexities of webRTC while providing a reactive store for data management with a unidirectional data flow
This is an addon to the core sdk provided by 100ms. It abstracts away the intricacies of data management and provides a flux based reactive data store where data flows in only one direction.
The complexity of managing the state of a room is not a trivial task and can spiral out of control very fast. For example, multiple UI components can be interested in a simple data point such as whether the user is currently muted. The mute action itself can be taken from multiple different places in the UI or even by a remote participant. Local states and improper handling of actions or missing corner cases, state duplication etc. have a high potential to make the data mutually inconsistent and out of sync with the source of truth.
This is an opinionated reactive layer on top of our core sdk which takes some control in order to provide an even easier usability and integration experience. Your UI components can forget about local states, and tracking what actions are happening, instead focusing only on giving the best possible experience to the end users.
There are two important pieces, store for what you want to show and actions for what you want to do -
We also provide optimized and efficient selectors for most common use cases. These are available in this folder.
Important Note: The data received from either getState or Subscribe is immutable, the object received is frozen, and it is not allowed to mutate it. You'll get an error if you try to mutate this data in any way. Immutability of the store is how we ensure it to be consistent and reflect the truth at any point of time.
yarn add @100mslive/hms-video-store
const hms = new HMSReactiveStore();
const hmsActions = hms.getHMSActions();
const hmsStore = hms.getStore();
const toggleAudio = () => {
const isEnabled = hmsStore.getState(selectIsLocalAudioEnabled);
hmsActions.setLocalAudioEnabled(!isEnabled);
}
const onSpeakerUpdate = (speaker, prevSpeaker) => {
console.log("speaker changed from - ", prevSpeaker, ", to - ", speaker);
}
hmsStore.subscribe(onSpeakerUpdate, selectDominantSpeaker);
Most of the popular javascript frameworks are reactive in nature and have some kind of associated concept which can simplify development further. We plan to provide a few framework specific wrappers as well for smoother integration.
We provide two hooks one for reading for the store and another for taking actions. We provide a HMSRoomProvider component which takes care of initialization and making these hooks available to your UI components.
function join() {
const isConnected = useHMSStore(selectIsConnectedToRoom);
const hmsActions = useHMSActions();
return <>
{
!isConnected &&
<Button onClick={() => hmsActions.join()}>Join</Button>
}
</>
}
Refer to docs for more detailed guide
FAQs
@100mslive Core SDK which abstracts the complexities of webRTC while providing a reactive store for data management with a unidirectional data flow
The npm package @100mslive/hms-video-store receives a total of 18,376 weekly downloads. As such, @100mslive/hms-video-store popularity was classified as popular.
We found that @100mslive/hms-video-store demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.