
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-chat
Advanced tools
A React hook for state management in ConnectyCube-powered chat solutions
A React hook for state management in ConnectyCube-powered chat solutions.
This library provides a headless solution for managing chat functionality in ConnectyCube. Similar to how Formik simplifies form handling, this library streamlines the development of chat applications.
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
or
yarn add @connectycube/use-chat
import { useChat } from "@connectycube/use-chat";
const MyComponent = () => {
const { connect, createChat, sendMessage, selectedDialog } = useChat();
const handleConnect = async () => {
const chatCredentials = {
userId: 22,
password: "password",
};
await connect(chatCredentials);
};
const handleCreateChat = async () => {
const userId = 456;
const dialog = await createChat(userId);
await selectDialog(dialog);
};
const handleSendMessage = async () => {
// send message to selected dialog
sendMessage("Hi there");
};
return (
<div className="container">
<button type="button" onClick={handleConnect}>
Connect
</button>
<button type="button" onClick={handleCreateChat}>
Create chat
</button>
<button type="button" onClick={handleSendMessage}>
Send message
</button>
</div>
);
};
export default MyComponent;
For more complex example please check React chat code sample
Check types for more API examples https://github.com/ConnectyCube/use-chat/blob/main/src/types/index.ts
https://developers.connectycube.com/js/use-chat
Join our Discord community to get real-time help from our team
FAQs
A React hook for state management in ConnectyCube-powered chat solutions
The npm package @connectycube/use-chat receives a total of 16 weekly downloads. As such, @connectycube/use-chat popularity was classified as not popular.
We found that @connectycube/use-chat 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.