
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@connectycube/use-calls
Advanced tools
A React hook for state management in ConnectyCube-powered audio/video calls solutions
A React hook for state management in ConnectyCube-powered audio/video calls solutions.
This library provides a headless solution for managing calls functionality in ConnectyCube.
The core purpose is to handle essential chat features like state management, handling subsequent events and APIs properly etc, so the end user takes care about UI building only.
npm install @connectycube/use-chat @connectycube/use-calls
or
yarn add @connectycube/use-chat @connectycube/use-calls
import { useEffect } from "react";
import { useChat } from "@connectycube/use-chat";
import { useCalls, LocalStream, RemoteStream, CallType } from "@connectycube/use-calls";
const StartCallDemo: React.FC<{ calleeID: number }> = ({ calleeID }) => {
const { connect } = useChat();
const { activeCall, startCall, stopCall, participantsIds } = useCalls();
const _startCall = () => {
startCall(calleeID, CallType.VIDEO, { userName: "Alice", type: "video" });
};
const _stopCall = () => {
stopCall();
};
useEffect(() => {
connect({ userId: 123450, password: "password1" });
}, []);
return (
<div className="container">
...
<button type="button" onClick={_startCall}>
Start call
</button>
<button type="button" onClick={_stopCall}>
Stop call
</button>
{activeCall && (
<div className="media-container">
{participantsIds.map((id) => (
<RemoteStream userID={id} />
))}
<LocalStream />
</div>
)}
</div>
);
};
export default StartCallDemo;
import { useState, useEffect } from "react";
import { useChat } from "@connectycube/use-chat";
import { useCalls, LocalStream, RemoteStream } from "@connectycube/use-calls";
const ReceiveCallDemo = () => {
const { connect } = useChat();
const { incomingCall, activeCall, acceptCall, rejectCall, participantsIds } = useCalls();
useEffect(() => {
if (incomingCall) {
const accepted = confirm(`Incoming ${extension.type} call from ${extension.userName}`);
if (accepted) {
acceptCall();
} else {
rejectCall();
}
}
}, [incomingCall]);
useEffect(() => {
await connect({ userId: 123451, password: "password2" });
}, []);
return (
<div className="container">
...
{activeCall && (
<div className="media-container">
{participantsIds.map((id) => (
<RemoteStream userID={id} />
))}
<LocalStream />
</div>
)}
</div>
);
};
export default ReceiveCallDemo;
For more complex example please check Video Chat code sample
https://developers.connectycube.com/js/use-calls
Join our Discord for quick answers to your questions
FAQs
A React hook for state management in ConnectyCube-powered audio/video calls solutions
We found that @connectycube/use-calls demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.